Spaces:
Runtime error
Runtime error
Ralitza Mondal commited on
Commit ·
90c11ad
1
Parent(s): 5fa9025
Fix app.py for Hugging Face Spaces deployment
Browse files- Change default host from 127.0.0.1 to 0.0.0.0 for HF compatibility
- Remove show_error parameter from launch() for better HF integration
- App will now bind to all interfaces allowing HF to proxy correctly
app.py
CHANGED
|
@@ -345,7 +345,7 @@ def main():
|
|
| 345 |
parser = argparse.ArgumentParser(description="AI Finance Assistant")
|
| 346 |
parser.add_argument("--share", action="store_true", help="Create public Gradio link")
|
| 347 |
parser.add_argument("--port", type=int, default=7860, help="Port to run on (default: 7860)")
|
| 348 |
-
parser.add_argument("--host", type=str, default="
|
| 349 |
args = parser.parse_args()
|
| 350 |
|
| 351 |
# Load environment variables
|
|
@@ -393,11 +393,11 @@ def main():
|
|
| 393 |
print("🔗 Creating public link (share=True)...")
|
| 394 |
print(f"{'='*60}\n")
|
| 395 |
|
|
|
|
| 396 |
interface.launch(
|
| 397 |
server_name=args.host,
|
| 398 |
server_port=args.port,
|
| 399 |
-
share=args.share
|
| 400 |
-
show_error=True
|
| 401 |
)
|
| 402 |
|
| 403 |
|
|
|
|
| 345 |
parser = argparse.ArgumentParser(description="AI Finance Assistant")
|
| 346 |
parser.add_argument("--share", action="store_true", help="Create public Gradio link")
|
| 347 |
parser.add_argument("--port", type=int, default=7860, help="Port to run on (default: 7860)")
|
| 348 |
+
parser.add_argument("--host", type=str, default="0.0.0.0", help="Host to bind to (default: 0.0.0.0 for Hugging Face)")
|
| 349 |
args = parser.parse_args()
|
| 350 |
|
| 351 |
# Load environment variables
|
|
|
|
| 393 |
print("🔗 Creating public link (share=True)...")
|
| 394 |
print(f"{'='*60}\n")
|
| 395 |
|
| 396 |
+
# Launch with simplified settings for Hugging Face compatibility
|
| 397 |
interface.launch(
|
| 398 |
server_name=args.host,
|
| 399 |
server_port=args.port,
|
| 400 |
+
share=args.share
|
|
|
|
| 401 |
)
|
| 402 |
|
| 403 |
|