kamil1300 commited on
Commit
48944d2
·
verified ·
1 Parent(s): e83c533

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -213,25 +213,27 @@ with gr.Blocks() as demo:
213
  )
214
 
215
  if __name__ == "__main__":
216
- print("\n" + "-"*30 + " App Starting " + "-"*30)
217
- # Check for SPACE_HOST and SPACE_ID at startup for information
 
218
  space_host_startup = os.getenv("SPACE_HOST")
219
- space_id_startup = os.getenv("SPACE_ID") # Get SPACE_ID at startup
220
 
221
  if space_host_startup:
222
  print(f"✅ SPACE_HOST found: {space_host_startup}")
223
- print(f" Runtime URL should be: https://{space_host_startup}.hf.space")
224
  else:
225
- print("ℹ️ SPACE_HOST environment variable not found (running locally?).")
226
 
227
- if space_id_startup: # Print repo URLs if SPACE_ID is found
228
  print(f"✅ SPACE_ID found: {space_id_startup}")
229
  print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
230
- print(f" Repo Tree URL: https://huggingface.co/spaces/{space_id_startup}/tree/main")
231
  else:
232
- print("ℹ️ SPACE_ID environment variable not found (running locally?). Repo URL cannot be determined.")
233
-
234
- print("-"*(60 + len(" App Starting ")) + "\n")
235
 
 
236
  print("Launching Gradio Interface for Basic Agent Evaluation...")
237
- demo.launch(debug=True, share=True)
 
 
 
213
  )
214
 
215
  if __name__ == "__main__":
216
+ print("\n" + "-" * 30 + " App Starting " + "-" * 30)
217
+
218
+ # Print helpful startup info
219
  space_host_startup = os.getenv("SPACE_HOST")
220
+ space_id_startup = os.getenv("SPACE_ID")
221
 
222
  if space_host_startup:
223
  print(f"✅ SPACE_HOST found: {space_host_startup}")
224
+ print(f" Runtime URL: https://{space_host_startup}.hf.space")
225
  else:
226
+ print("ℹ️ SPACE_HOST not found. Likely running locally.")
227
 
228
+ if space_id_startup:
229
  print(f"✅ SPACE_ID found: {space_id_startup}")
230
  print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
231
+ print(f" Repo Tree: https://huggingface.co/spaces/{space_id_startup}/tree/main")
232
  else:
233
+ print("ℹ️ SPACE_ID not found. Repo URL cannot be determined.")
 
 
234
 
235
+ print("-" * 70)
236
  print("Launching Gradio Interface for Basic Agent Evaluation...")
237
+
238
+ # Do NOT use share=True in Hugging Face Space
239
+ demo.launch() # Hugging Face handles URL + SSR internally