Spaces:
Paused
Paused
Upload code/demo.py with huggingface_hub
Browse files- code/demo.py +3 -1
code/demo.py
CHANGED
|
@@ -514,9 +514,11 @@ if __name__ == "__main__":
|
|
| 514 |
|
| 515 |
if is_hf_space:
|
| 516 |
print("🌐 运行环境: Hugging Face Spaces")
|
| 517 |
-
# Hugging Face Spaces
|
| 518 |
demo.queue()
|
| 519 |
demo.launch(
|
|
|
|
|
|
|
| 520 |
show_error=True,
|
| 521 |
allowed_paths=[os.path.abspath(DEFAULT_PART_RENDER_PATH)]
|
| 522 |
)
|
|
|
|
| 514 |
|
| 515 |
if is_hf_space:
|
| 516 |
print("🌐 运行环境: Hugging Face Spaces")
|
| 517 |
+
# Hugging Face Spaces Docker SDK 需要显式指定端口
|
| 518 |
demo.queue()
|
| 519 |
demo.launch(
|
| 520 |
+
server_name="0.0.0.0",
|
| 521 |
+
server_port=7860,
|
| 522 |
show_error=True,
|
| 523 |
allowed_paths=[os.path.abspath(DEFAULT_PART_RENDER_PATH)]
|
| 524 |
)
|