Update ff.py
Browse files
ff.py
CHANGED
|
@@ -195,13 +195,17 @@ def create_space(type,key = "", value = ""):
|
|
| 195 |
telegram_message(BOT_TOKEN, CHAT_ID, f"{HF_ID}下载Dockerfile下载失败,状态码: {response.status_code}")
|
| 196 |
|
| 197 |
# os.system(f"wget -O '/data/{tmp_name}/Dockerfile' https://huggingface.co/datasets/Qilan2/ff/raw/main/Dockerfile")
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
def get_latest_local_package(directory, pattern='*.tar.gz'):
|
| 206 |
try:
|
| 207 |
# 构建完整的搜索路径
|
|
|
|
| 195 |
telegram_message(BOT_TOKEN, CHAT_ID, f"{HF_ID}下载Dockerfile下载失败,状态码: {response.status_code}")
|
| 196 |
|
| 197 |
# os.system(f"wget -O '/data/{tmp_name}/Dockerfile' https://huggingface.co/datasets/Qilan2/ff/raw/main/Dockerfile")
|
| 198 |
+
repo_path = f"/data/{tmp_name}"
|
| 199 |
+
subprocess.run(["git", "-C", repo_path, "add", "."], check=True)
|
| 200 |
+
subprocess.run(["git", "-C", repo_path, "commit", "-m", commit_message], check=True)
|
| 201 |
+
subprocess.run(["git", "-C", repo_path, "push", "origin", "main"], check=True)
|
| 202 |
+
# os.system('git add .')
|
| 203 |
+
# os.system('git commit -m "0"')
|
| 204 |
+
# push_result = os.system('git push origin main')
|
| 205 |
+
# if push_result != 0:
|
| 206 |
+
# print("推送失败,可能有冲突,尝试拉取并合并...")
|
| 207 |
+
# os.system('git pull origin main --rebase')
|
| 208 |
+
# os.system('git push origin main')
|
| 209 |
def get_latest_local_package(directory, pattern='*.tar.gz'):
|
| 210 |
try:
|
| 211 |
# 构建完整的搜索路径
|