Bryceeee commited on
Commit
06135cc
Β·
verified Β·
1 Parent(s): 074c6ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -11
app.py CHANGED
@@ -223,6 +223,7 @@ def create_app():
223
  # Wrap in try-except to ensure demo is always defined
224
  try:
225
  demo = create_app()
 
226
  except Exception as e:
227
  print(f"❌ Fatal error creating app: {e}")
228
  import traceback
@@ -266,18 +267,25 @@ if __name__ == "__main__":
266
  auth_password = os.getenv("APP_PASSWORD")
267
 
268
  # If a username and password are set, authentication will be enabled
269
- auth_tuple = None
270
  if auth_username and auth_password:
271
- auth_tuple = (auth_username, auth_password)
272
- print("πŸ”’ Authentication enabled")
273
  else:
274
- print("⚠️ No authentication configured")
275
 
276
- demo.launch(
277
- share=False,
278
- server_name="0.0.0.0",
279
- server_port=7860,
280
- auth=auth_tuple,
281
- ssr_mode=False
282
- )
 
 
 
 
 
 
 
283
 
 
223
  # Wrap in try-except to ensure demo is always defined
224
  try:
225
  demo = create_app()
226
+ print("βœ… App created successfully!")
227
  except Exception as e:
228
  print(f"❌ Fatal error creating app: {e}")
229
  import traceback
 
267
  auth_password = os.getenv("APP_PASSWORD")
268
 
269
  # If a username and password are set, authentication will be enabled
270
+ auth_config = None
271
  if auth_username and auth_password:
272
+ auth_config = (auth_username, auth_password)
273
+ print(f"πŸ”’ Authentication enabled for user: {auth_username}")
274
  else:
275
+ print("⚠️ No authentication configured. App is publicly accessible.")
276
 
277
+ print("πŸš€ Launching Gradio app...")
278
+
279
+ try:
280
+ demo.launch(
281
+ share=False,
282
+ server_name="0.0.0.0",
283
+ server_port=7860,
284
+ auth=auth_config
285
+ )
286
+ print("βœ… App launched successfully!")
287
+ except Exception as e:
288
+ print(f"❌ Error launching app: {e}")
289
+ import traceback
290
+ traceback.print_exc()
291