Natwar commited on
Commit
8ee7fe3
Β·
verified Β·
1 Parent(s): fe98774

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -1189,7 +1189,20 @@ if __name__ == "__main__":
1189
  print("πŸ“ Excel Input β†’ AI Processing β†’ Excel/Word Output")
1190
  print("πŸ”„ Optimized comparison tables for 'At-a-Glance Matrix' sections")
1191
  print("="*70)
 
1192
  interface = create_interface()
1193
- # MODIFIED: Launch call is simplified for Hugging Face deployment
1194
- interface.launch(auth=("your_username", "your_password"))
 
 
 
 
 
 
 
 
 
 
 
 
1195
  print("βœ… Unified blog generator launched!")
 
1189
  print("πŸ“ Excel Input β†’ AI Processing β†’ Excel/Word Output")
1190
  print("πŸ”„ Optimized comparison tables for 'At-a-Glance Matrix' sections")
1191
  print("="*70)
1192
+
1193
  interface = create_interface()
1194
+
1195
+ # MODIFIED: Get Gradio credentials from Hugging Face Secrets
1196
+ gradio_user = os.environ.get("GRADIO_USERNAME")
1197
+ gradio_pass = os.environ.get("GRADIO_PASSWORD")
1198
+
1199
+ # Ensure both secrets are set. If not, the app will raise an error and fail to start.
1200
+ if not (gradio_user and gradio_pass):
1201
+ raise ValueError("πŸ”΄ ERROR: GRADIO_USERNAME and GRADIO_PASSWORD secrets must be set in your Hugging Face Space for authentication.")
1202
+
1203
+ print("βœ… Gradio authentication enabled.")
1204
+
1205
+ # Launch the interface with credentials from the secrets
1206
+ interface.launch(auth=(gradio_user, gradio_pass))
1207
+
1208
  print("βœ… Unified blog generator launched!")