IAGO / app.py
James Frecheville
Update dependencies and add more environment variables to prevent browser installation
6dd1eb7
raw
history blame
834 Bytes
import os
import sys
from pathlib import Path
# Add current directory to Python path
current_dir = Path(__file__).parent.absolute()
if str(current_dir) not in sys.path:
sys.path.append(str(current_dir))
# Disable browser installation and analytics
os.environ["GRADIO_ANALYTICS_ENABLED"] = "false"
os.environ["GRADIO_BROWSER_INSTALLED"] = "true"
os.environ["GRADIO_SERVER_NAME"] = "0.0.0.0"
os.environ["GRADIO_SERVER_PORT"] = "7861"
os.environ["GRADIO_ALLOW_FLAGGING"] = "false"
os.environ["GRADIO_QUEUE_ENABLED"] = "false"
from owl.webapp import create_ui
# Create Gradio interface
demo = create_ui()
# Launch the app
if __name__ == "__main__":
demo.launch(
server_name="0.0.0.0",
server_port=7861,
share=False,
show_error=True,
favicon_path=None,
allowed_paths=None
)