Spaces:
Sleeping
Sleeping
BrianChuan commited on
Commit ·
ad4a621
1
Parent(s): 5b7fa18
UI fix test
Browse files
app.py
CHANGED
|
@@ -1238,11 +1238,12 @@ api_app.add_middleware(
|
|
| 1238 |
allow_origins=["*"],
|
| 1239 |
allow_methods=["*"],
|
| 1240 |
allow_headers=["*"],
|
|
|
|
| 1241 |
)
|
| 1242 |
|
| 1243 |
if __name__ == "__main__":
|
| 1244 |
# 1. 取得環境變數,HF 預設 PORT 通常是 7860,HOST 務必用 0.0.0.0
|
| 1245 |
-
host =
|
| 1246 |
port = int(os.getenv("PORT", 7860))
|
| 1247 |
|
| 1248 |
try:
|
|
@@ -1262,6 +1263,7 @@ if __name__ == "__main__":
|
|
| 1262 |
port=port,
|
| 1263 |
proxy_headers=True,
|
| 1264 |
forwarded_allow_ips="*"
|
|
|
|
| 1265 |
)
|
| 1266 |
|
| 1267 |
except Exception as e:
|
|
|
|
| 1238 |
allow_origins=["*"],
|
| 1239 |
allow_methods=["*"],
|
| 1240 |
allow_headers=["*"],
|
| 1241 |
+
allow_credentials=True,
|
| 1242 |
)
|
| 1243 |
|
| 1244 |
if __name__ == "__main__":
|
| 1245 |
# 1. 取得環境變數,HF 預設 PORT 通常是 7860,HOST 務必用 0.0.0.0
|
| 1246 |
+
host = "0.0.0.0"
|
| 1247 |
port = int(os.getenv("PORT", 7860))
|
| 1248 |
|
| 1249 |
try:
|
|
|
|
| 1263 |
port=port,
|
| 1264 |
proxy_headers=True,
|
| 1265 |
forwarded_allow_ips="*"
|
| 1266 |
+
log_level="info"
|
| 1267 |
)
|
| 1268 |
|
| 1269 |
except Exception as e:
|