Spaces:
Sleeping
Sleeping
Update main.py
Browse files- back_end/main.py +7 -0
back_end/main.py
CHANGED
|
@@ -191,3 +191,10 @@ async def chat_stream(request: ChatRequest):
|
|
| 191 |
await asyncio.sleep(0.01)
|
| 192 |
|
| 193 |
return StreamingResponse(generate_response(), media_type="text/event-stream")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
await asyncio.sleep(0.01)
|
| 192 |
|
| 193 |
return StreamingResponse(generate_response(), media_type="text/event-stream")
|
| 194 |
+
|
| 195 |
+
# 1. Find the path to the front_end folder
|
| 196 |
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 197 |
+
frontend_dir = os.path.join(current_dir, "..", "front_end")
|
| 198 |
+
|
| 199 |
+
# 2. Tell FastAPI to serve your index.html when people visit the main URL
|
| 200 |
+
app.mount("/", StaticFiles(directory=frontend_dir, html=True), name="frontend")
|