Csaba Bolyos commited on
Commit
f54601d
·
1 Parent(s): 5c8fcb4

Fix Hugging Face Spaces configuration - Fix app.py import, update README metadata, add error handling

Browse files
README.md CHANGED
@@ -5,7 +5,7 @@ colorFrom: blue
5
  colorTo: green
6
  sdk: gradio
7
  sdk_version: 5.0.0
8
- app_file: space.py
9
  pinned: false
10
  license: mit
11
  tags:
 
5
  colorTo: green
6
  sdk: gradio
7
  sdk_version: 5.0.0
8
+ app_file: app.py
9
  pinned: false
10
  license: mit
11
  tags:
app.py CHANGED
@@ -13,6 +13,7 @@ Heavy Beta Version - Under Active Development
13
  """
14
 
15
  import sys
 
16
  from pathlib import Path
17
 
18
  # Import version info
@@ -27,22 +28,46 @@ except ImportError:
27
  sys.path.insert(0, str(Path(__file__).parent / "demo"))
28
 
29
  try:
30
- from app import create_unified_demo
 
31
 
32
  if __name__ == "__main__":
 
33
  demo = create_unified_demo()
 
 
34
  demo.launch(
35
  server_name="0.0.0.0",
36
- server_port=7860,
37
  share=False,
38
  show_error=True,
39
  favicon_path=None,
40
- show_api=True
 
41
  )
42
 
43
  except ImportError as e:
44
- print(f"Import error: {e}")
45
  print("Make sure all dependencies are installed.")
 
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  except Exception as e:
48
- print(f"Error launching demo: {e}")
 
 
13
  """
14
 
15
  import sys
16
+ import os
17
  from pathlib import Path
18
 
19
  # Import version info
 
28
  sys.path.insert(0, str(Path(__file__).parent / "demo"))
29
 
30
  try:
31
+ # Import from demo.app to avoid circular import
32
+ from demo.app import create_unified_demo
33
 
34
  if __name__ == "__main__":
35
+ print("🚀 Starting Laban Movement Analysis...")
36
  demo = create_unified_demo()
37
+
38
+ # Configure for Hugging Face Spaces
39
  demo.launch(
40
  server_name="0.0.0.0",
41
+ server_port=int(os.environ.get("PORT", 7860)),
42
  share=False,
43
  show_error=True,
44
  favicon_path=None,
45
+ show_api=True,
46
+ enable_queue=True
47
  )
48
 
49
  except ImportError as e:
50
+ print(f"Import error: {e}")
51
  print("Make sure all dependencies are installed.")
52
+ print("Trying alternative import method...")
53
 
54
+ # Fallback import method
55
+ try:
56
+ import importlib.util
57
+ spec = importlib.util.spec_from_file_location("demo_app", Path(__file__).parent / "demo" / "app.py")
58
+ demo_module = importlib.util.module_from_spec(spec)
59
+ spec.loader.exec_module(demo_module)
60
+
61
+ demo = demo_module.create_unified_demo()
62
+ demo.launch(
63
+ server_name="0.0.0.0",
64
+ server_port=int(os.environ.get("PORT", 7860)),
65
+ share=False,
66
+ show_error=True
67
+ )
68
+ except Exception as fallback_error:
69
+ print(f"❌ Fallback failed: {fallback_error}")
70
+
71
  except Exception as e:
72
+ print(f"Error launching demo: {e}")
73
+ print("Check the logs above for more details.")
backend/gradio_labanmovementanalysis/__pycache__/__init__.cpython-312.pyc CHANGED
Binary files a/backend/gradio_labanmovementanalysis/__pycache__/__init__.cpython-312.pyc and b/backend/gradio_labanmovementanalysis/__pycache__/__init__.cpython-312.pyc differ