Spaces:
Running
Running
Download app.py from rvdbra/EinbuergDemoforTesting: direct link, hf CLI and curl.
- Browser
- Download file 565 Bytes
-
https://huggingface.co/spaces/rvdbra/EinbuergDemoforTesting/resolve/main/app.py
- Command line
-
hf download hf://spaces/rvdbra/EinbuergDemoforTesting/app.py
-
curl -L -o app.py https://huggingface.co/spaces/rvdbra/EinbuergDemoforTesting/resolve/main/app.py
565 Bytes
| import uvicorn | |
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from gradio.routes import mount_gradio_app | |
| from ui.gradio_app import iface | |
| origins = [ | |
| "https://zum-deutschen-pass.de", | |
| "http://127.0.0.1:5500", | |
| ] | |
| app = FastAPI() | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=origins, | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| mount_gradio_app(app, iface, path="/") | |
| print("app imported successfully") | |
| if __name__ == "__main__": | |
| uvicorn.run(app, host="0.0.0.0", port=7860) | |