Spaces:
Sleeping
Sleeping
alanchen1115
commited on
Update main.py
Browse files
main.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
from fastapi.middleware.cors import CORSMiddleware
|
2 |
-
from fastapi import FastAPI, Request, Header, BackgroundTasks, HTTPException, status
|
3 |
from gradio_client import Client
|
4 |
import json
|
5 |
import os
|
@@ -24,7 +24,7 @@ working_status = os.getenv("DEFALUT_TALKING", default = "true").lower() == "true
|
|
24 |
|
25 |
# 建立 FastAPI 應用程式
|
26 |
app = FastAPI()
|
27 |
-
app.mount("/static", StaticFiles(directory="static"), name="static")
|
28 |
|
29 |
# 設定 CORS,允許跨域請求
|
30 |
app.add_middleware(
|
|
|
1 |
from fastapi.middleware.cors import CORSMiddleware
|
2 |
+
from fastapi import FastAPI, Request, Header, BackgroundTasks, HTTPException, status, staticfiles
|
3 |
from gradio_client import Client
|
4 |
import json
|
5 |
import os
|
|
|
24 |
|
25 |
# 建立 FastAPI 應用程式
|
26 |
app = FastAPI()
|
27 |
+
app.mount("/static", staticfiles.StaticFiles(directory="static"), name="static")
|
28 |
|
29 |
# 設定 CORS,允許跨域請求
|
30 |
app.add_middleware(
|