Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 1194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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!")
|