sam133 commited on
Commit
0fe9c4b
·
1 Parent(s): ee969dd

� PHASE 5

Browse files
Files changed (2) hide show
  1. app.py +50 -4
  2. requirements.txt +3 -2
app.py CHANGED
@@ -4,6 +4,35 @@ Agent2Robot - MINIMAL WORKING VERSION
4
  Based on successful Step 4 but with simple return function
5
  """
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  import gradio as gr
8
 
9
  def simple_test_function(vehicle_type, user_description):
@@ -162,14 +191,31 @@ if __name__ == "__main__":
162
 
163
  try:
164
  app = create_minimal_working_app()
 
 
 
165
  app.launch(
166
  server_name="0.0.0.0",
167
  server_port=7860,
168
- share=False,
169
  show_error=True,
170
- inbrowser=True,
171
- quiet=False
 
172
  )
173
  except Exception as e:
174
  print(f"❌ Error launching app: {e}")
175
- print("Even minimal version has issues!")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  Based on successful Step 4 but with simple return function
5
  """
6
 
7
+ import os
8
+ import ssl
9
+
10
+ # Multiple SSL fixes for Windows/conda environments
11
+ try:
12
+ # Try to fix SSL certificate path
13
+ import certifi
14
+ os.environ['SSL_CERT_FILE'] = certifi.where()
15
+ os.environ['REQUESTS_CA_BUNDLE'] = certifi.where()
16
+ except ImportError:
17
+ print("⚠️ Warning: certifi not available, using alternative SSL fix")
18
+
19
+ # Disable SSL verification if needed (for development only)
20
+ ssl._create_default_https_context = ssl._create_unverified_context
21
+
22
+ # Alternative approach: Set empty SSL_CERT_FILE if the current one is problematic
23
+ if 'SSL_CERT_FILE' in os.environ:
24
+ try:
25
+ with open(os.environ['SSL_CERT_FILE'], 'r') as f:
26
+ pass # Test if file is readable
27
+ except:
28
+ # If the current SSL_CERT_FILE is problematic, try to unset it
29
+ del os.environ['SSL_CERT_FILE']
30
+ try:
31
+ import certifi
32
+ os.environ['SSL_CERT_FILE'] = certifi.where()
33
+ except:
34
+ pass
35
+
36
  import gradio as gr
37
 
38
  def simple_test_function(vehicle_type, user_description):
 
191
 
192
  try:
193
  app = create_minimal_working_app()
194
+ print("✅ App created successfully")
195
+ print("🌐 Launching with share=True (since localhost not accessible)...")
196
+
197
  app.launch(
198
  server_name="0.0.0.0",
199
  server_port=7860,
200
+ share=True, # Fixed: Set to True since localhost is not accessible
201
  show_error=True,
202
+ inbrowser=False, # Changed to False to avoid browser issues
203
+ quiet=False,
204
+ debug=True # Added debug mode for better error reporting
205
  )
206
  except Exception as e:
207
  print(f"❌ Error launching app: {e}")
208
+ print("Even minimal version has issues!")
209
+
210
+ # Additional debugging information
211
+ import traceback
212
+ print("\n🔍 Full error traceback:")
213
+ traceback.print_exc()
214
+
215
+ # Try alternative launch with minimal options
216
+ print("\n🔄 Trying alternative launch configuration...")
217
+ try:
218
+ app.launch(share=True, debug=True)
219
+ except Exception as e2:
220
+ print(f"❌ Alternative launch also failed: {e2}")
221
+ print("Please check Gradio installation and dependencies.")
requirements.txt CHANGED
@@ -1,12 +1,13 @@
1
  # Minimal requirements for Phase 1 debugging
2
- gradio>=4.44.1
 
 
3
  # imageio>=2.20.0
4
  # transformers>=4.21.0
5
  # torch>=1.12.0
6
  # Pillow>=9.0.0
7
  # numpy>=1.21.0
8
  # requests>=2.28.0
9
- # certifi>=2022.0.0
10
  # mcp>=1.0.0
11
  # fastapi>=0.100.0
12
  # uvicorn>=0.20.0
 
1
  # Minimal requirements for Phase 1 debugging
2
+ gradio>=4.44.1,<5.0.0
3
+ # gradio_client will be automatically installed with compatible version by gradio
4
+ certifi>=2022.0.0
5
  # imageio>=2.20.0
6
  # transformers>=4.21.0
7
  # torch>=1.12.0
8
  # Pillow>=9.0.0
9
  # numpy>=1.21.0
10
  # requests>=2.28.0
 
11
  # mcp>=1.0.0
12
  # fastapi>=0.100.0
13
  # uvicorn>=0.20.0