Speedofmastery commited on
Commit
03ea644
Β·
1 Parent(s): 6c9cf0d

Auto-commit: app.py updated

Browse files
Files changed (1) hide show
  1. app.py +16 -14
app.py CHANGED
@@ -12,23 +12,26 @@ from pathlib import Path
12
  current_dir = Path(__file__).parent
13
  sys.path.insert(0, str(current_dir))
14
 
 
15
  def main():
16
  """Main entry point for HuggingFace Spaces"""
17
  try:
18
  print("πŸš€ Starting OpenManus Platform...")
19
-
20
  # Try to import and run the simple app
21
  from app_simple import main as simple_main
 
22
  simple_main()
23
-
24
  except ImportError as e:
25
  print(f"⚠️ Import error: {e}")
26
  try:
27
  # Fallback to basic Gradio interface
28
  import gradio as gr
29
-
30
  with gr.Blocks(title="OpenManus - Starting...") as demo:
31
- gr.HTML("""
 
32
  <div style="text-align: center; padding: 50px;">
33
  <h1>πŸ€– OpenManus Platform</h1>
34
  <h2>βœ… Successfully Deployed!</h2>
@@ -43,26 +46,25 @@ def main():
43
  </ul>
44
  <p><em>System is working! Deployment successful.</em></p>
45
  </div>
46
- """)
47
-
48
- demo.launch(
49
- server_name="0.0.0.0",
50
- server_port=7860,
51
- share=False
52
- )
53
-
54
  except Exception as e2:
55
  print(f"❌ Critical error: {e2}")
56
  # Last resort
57
  print("OpenManus Platform - Basic Mode")
58
  print("βœ… Deployment successful!")
59
  print("πŸ”§ System starting in minimal mode...")
60
-
61
  # Keep the process alive
62
  import time
 
63
  while True:
64
  time.sleep(60)
65
  print("⏱️ OpenManus running...")
66
 
 
67
  if __name__ == "__main__":
68
- main()
 
12
  current_dir = Path(__file__).parent
13
  sys.path.insert(0, str(current_dir))
14
 
15
+
16
  def main():
17
  """Main entry point for HuggingFace Spaces"""
18
  try:
19
  print("πŸš€ Starting OpenManus Platform...")
20
+
21
  # Try to import and run the simple app
22
  from app_simple import main as simple_main
23
+
24
  simple_main()
25
+
26
  except ImportError as e:
27
  print(f"⚠️ Import error: {e}")
28
  try:
29
  # Fallback to basic Gradio interface
30
  import gradio as gr
31
+
32
  with gr.Blocks(title="OpenManus - Starting...") as demo:
33
+ gr.HTML(
34
+ """
35
  <div style="text-align: center; padding: 50px;">
36
  <h1>πŸ€– OpenManus Platform</h1>
37
  <h2>βœ… Successfully Deployed!</h2>
 
46
  </ul>
47
  <p><em>System is working! Deployment successful.</em></p>
48
  </div>
49
+ """
50
+ )
51
+
52
+ demo.launch(server_name="0.0.0.0", server_port=7860, share=False)
53
+
 
 
 
54
  except Exception as e2:
55
  print(f"❌ Critical error: {e2}")
56
  # Last resort
57
  print("OpenManus Platform - Basic Mode")
58
  print("βœ… Deployment successful!")
59
  print("πŸ”§ System starting in minimal mode...")
60
+
61
  # Keep the process alive
62
  import time
63
+
64
  while True:
65
  time.sleep(60)
66
  print("⏱️ OpenManus running...")
67
 
68
+
69
  if __name__ == "__main__":
70
+ main()