mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-22 22:02:51 +08:00
parent
a83756b5e9
commit
913ee05e74
@ -57,7 +57,8 @@ async def lifespan(app: "FastAPI"): # collects GPU memory
|
|||||||
|
|
||||||
|
|
||||||
def create_app(chat_model: "ChatModel") -> "FastAPI":
|
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(
|
app.add_middleware(
|
||||||
CORSMiddleware,
|
CORSMiddleware,
|
||||||
allow_origins=["*"],
|
allow_origins=["*"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user