dylanglenister
commited on
Commit
·
daebdfa
1
Parent(s):
529b733
Confirmed testing.
Browse filesStart.py is not needed for the Huggingface deployment and has been marked as such.
app.py
CHANGED
|
@@ -3,7 +3,6 @@
|
|
| 3 |
|
| 4 |
from contextlib import asynccontextmanager
|
| 5 |
|
| 6 |
-
import uvicorn
|
| 7 |
from fastapi import FastAPI, HTTPException
|
| 8 |
from fastapi.middleware.cors import CORSMiddleware
|
| 9 |
from fastapi.responses import HTMLResponse
|
|
@@ -100,16 +99,6 @@ app.add_middleware(
|
|
| 100 |
allow_headers=["*"],
|
| 101 |
)
|
| 102 |
|
| 103 |
-
@app.get("/", response_class=HTMLResponse)
|
| 104 |
-
async def get_medical_chatbot():
|
| 105 |
-
"""Serve the medical chatbot UI"""
|
| 106 |
-
try:
|
| 107 |
-
with open("static/index.html", "r", encoding="utf-8") as f:
|
| 108 |
-
html_content = f.read()
|
| 109 |
-
return HTMLResponse(content=html_content)
|
| 110 |
-
except FileNotFoundError:
|
| 111 |
-
raise HTTPException(status_code=404, detail="Medical chatbot UI not found")
|
| 112 |
-
|
| 113 |
# Include routers
|
| 114 |
app.include_router(chat.router)
|
| 115 |
app.include_router(user.router)
|
|
@@ -119,10 +108,12 @@ app.include_router(system.router)
|
|
| 119 |
# Mount static files
|
| 120 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
| 121 |
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
from contextlib import asynccontextmanager
|
| 5 |
|
|
|
|
| 6 |
from fastapi import FastAPI, HTTPException
|
| 7 |
from fastapi.middleware.cors import CORSMiddleware
|
| 8 |
from fastapi.responses import HTMLResponse
|
|
|
|
| 99 |
allow_headers=["*"],
|
| 100 |
)
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
# Include routers
|
| 103 |
app.include_router(chat.router)
|
| 104 |
app.include_router(user.router)
|
|
|
|
| 108 |
# Mount static files
|
| 109 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
| 110 |
|
| 111 |
+
@app.get("/", response_class=HTMLResponse)
|
| 112 |
+
async def get_medical_chatbot():
|
| 113 |
+
"""Serve the medical chatbot UI"""
|
| 114 |
+
try:
|
| 115 |
+
with open("static/index.html", "r", encoding="utf-8") as f:
|
| 116 |
+
html_content = f.read()
|
| 117 |
+
return HTMLResponse(content=html_content)
|
| 118 |
+
except FileNotFoundError:
|
| 119 |
+
raise HTTPException(status_code=404, detail="Medical chatbot UI not found")
|
start.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
"""
|
| 3 |
Medical AI Assistant - Startup Script
|
| 4 |
Simple script to start the medical chatbot system
|
|
|
|
| 5 |
"""
|
| 6 |
|
| 7 |
import os
|
|
@@ -52,5 +53,4 @@ def main():
|
|
| 52 |
)
|
| 53 |
|
| 54 |
if __name__ == "__main__":
|
| 55 |
-
|
| 56 |
-
print("Starts here")
|
|
|
|
| 2 |
"""
|
| 3 |
Medical AI Assistant - Startup Script
|
| 4 |
Simple script to start the medical chatbot system
|
| 5 |
+
Not needed for huggingface deployment
|
| 6 |
"""
|
| 7 |
|
| 8 |
import os
|
|
|
|
| 53 |
)
|
| 54 |
|
| 55 |
if __name__ == "__main__":
|
| 56 |
+
main()
|
|
|