mgokg commited on
Commit
d8e48b4
·
verified ·
1 Parent(s): d0b84c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -77,11 +77,14 @@ stream = Stream(
77
  ],
78
  )
79
 
80
- # WICHTIG: Mountet den Stream in die FastAPI App
81
- stream.mount(app)
 
 
82
 
83
  if __name__ == "__main__":
84
  import uvicorn
85
- # Port 7860 für Hugging Face Spaces
86
  port = int(os.getenv("PORT", 7860))
 
87
  uvicorn.run(app, host="0.0.0.0", port=port)
 
77
  ],
78
  )
79
 
80
+ # ... (Handler und Stream Definitionen bleiben gleich)
81
+
82
+ # Wir nutzen stream.ui, was ein normales gradio.Blocks Objekt ist
83
+ app = gr.mount_gradio_app(FastAPI(), stream.ui, path="/")
84
 
85
  if __name__ == "__main__":
86
  import uvicorn
87
+ import os
88
  port = int(os.getenv("PORT", 7860))
89
+ # Wir starten die 'app' (FastAPI), die nun das Gradio UI auf "/" enthält
90
  uvicorn.run(app, host="0.0.0.0", port=port)