Spaces:
Running
Running
File size: 1,327 Bytes
80323f9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
#!/usr/bin/env python3
"""
Simple launcher for PerplexityViewer that handles common issues
"""
import sys
import os
def main():
"""Simple launcher with fallback options"""
print("π Starting PerplexityViewer...")
try:
# Try importing required modules
import gradio as gr
print(f"β
Gradio version: {gr.__version__}")
# Import the app
from app import demo
# Launch with minimal configuration
print("π Launching app at http://localhost:7860")
demo.launch()
except ImportError as e:
print(f"β Missing dependency: {e}")
print("π‘ Install requirements with: pip install -r requirements.txt")
sys.exit(1)
except Exception as e:
print(f"β Launch failed: {e}")
print("π‘ Trying alternative methods...")
# Try different launch approaches
try:
from app import demo
demo.launch(server_name="127.0.0.1", server_port=7860)
except:
try:
from app import demo
demo.launch(share=False, debug=True)
except:
print("β All launch methods failed")
print("π‘ Try running: python app.py directly")
sys.exit(1)
if __name__ == "__main__":
main()
|