File size: 506 Bytes
22c6426
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""
Open WebUI Hugging Face Space configuration
"""
import os
import subprocess
import sys

# Check if we're running in a Hugging Face Space
if "SPACE_ID" in os.environ:
    print("Running in Hugging Face Space")
    
    # Start the Open WebUI server
    subprocess.run(["uvicorn", "open_webui.main:app", "--host", "0.0.0.0", "--port", "7860", "--forwarded-allow-ips", "*"])
else:
    print("Not running in Hugging Face Space. Please use the Dockerfile to build and run the application.")
    sys.exit(1)