Former-commit-id: 63c19ddfe483a16c1c9afc2f1441e8070bb0f7e4
This commit is contained in:
hiyouga 2024-08-30 02:45:40 +08:00
parent c62a6ca59d
commit 30d97ca879

View File

@ -57,7 +57,8 @@ async def lifespan(app: "FastAPI"): # collects GPU memory
def create_app(chat_model: "ChatModel") -> "FastAPI":
app = FastAPI(lifespan=lifespan)
root_path = os.environ.get("FASTAPI_ROOT_PATH", "")
app = FastAPI(lifespan=lifespan, root_path=root_path)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],