Spaces:
Running
Running
KEYE commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,9 +7,9 @@ def setup_and_run():
|
|
| 7 |
repo_url = "https://github.com/renkexuan369/Infinity-Parser2-pro.git"
|
| 8 |
repo_dir = "Infinity-Parser2-pro"
|
| 9 |
|
| 10 |
-
# =========================================
|
| 11 |
# 1. 动态获取/拉取最新代码
|
| 12 |
-
# =========================================
|
| 13 |
if not os.path.exists(repo_dir):
|
| 14 |
logger.info(f"正在克隆仓库: {repo_url}")
|
| 15 |
subprocess.run(["git", "clone", repo_url], check=True)
|
|
@@ -24,9 +24,9 @@ def setup_and_run():
|
|
| 24 |
os.environ["GRADIO_SERVER_PORT"] = "7860"
|
| 25 |
os.environ["GRADIO_SERVER_NAME"] = "0.0.0.0"
|
| 26 |
|
| 27 |
-
# =========================================
|
| 28 |
# 2. 启动 Gradio 服务
|
| 29 |
-
# =========================================
|
| 30 |
logger.info("准备启动 inf_gradio.py ...")
|
| 31 |
|
| 32 |
# 关键:必须设置 cwd=repo_dir,否则 Python 找不到 utils.py 和 prompts.py
|
|
|
|
| 7 |
repo_url = "https://github.com/renkexuan369/Infinity-Parser2-pro.git"
|
| 8 |
repo_dir = "Infinity-Parser2-pro"
|
| 9 |
|
| 10 |
+
# =========================================
|
| 11 |
# 1. 动态获取/拉取最新代码
|
| 12 |
+
# =========================================
|
| 13 |
if not os.path.exists(repo_dir):
|
| 14 |
logger.info(f"正在克隆仓库: {repo_url}")
|
| 15 |
subprocess.run(["git", "clone", repo_url], check=True)
|
|
|
|
| 24 |
os.environ["GRADIO_SERVER_PORT"] = "7860"
|
| 25 |
os.environ["GRADIO_SERVER_NAME"] = "0.0.0.0"
|
| 26 |
|
| 27 |
+
# =========================================
|
| 28 |
# 2. 启动 Gradio 服务
|
| 29 |
+
# =========================================
|
| 30 |
logger.info("准备启动 inf_gradio.py ...")
|
| 31 |
|
| 32 |
# 关键:必须设置 cwd=repo_dir,否则 Python 找不到 utils.py 和 prompts.py
|