Opera8 commited on
Commit
1434eda
·
verified ·
1 Parent(s): 9bd9d27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -125,6 +125,7 @@ with tab1:
125
 
126
  run_command("git init")
127
  run_command("git lfs install")
 
128
  run_command(f"git remote add origin {auth_gh_url}")
129
  run_command("git add .")
130
  run_command('git config user.email "bot@transfer.com"')
@@ -169,7 +170,7 @@ with tab2:
169
  uploaded_zip_hf = None
170
 
171
  if source_type_hf == "لینک ریپازیتوری (گیت‌هاب و غیره)":
172
- src_url_hf = st.text_input("لینک ریپازیتوری منبع (مثلاً گیت‌هاب)",
173
  placeholder="https://github.com/user/repo.git", key="src_url_hf_input")
174
  else:
175
  uploaded_zip_hf = st.file_uploader("آپلود فایل ZIP (منبع)", type=["zip"], key="zip_hf_input")
@@ -209,7 +210,7 @@ with tab2:
209
  except Exception:
210
  pass
211
 
212
- # ایجاد آدرس با الگوی معتبر نام‌کاربری و توکن به جای __token__
213
  auth_hf_url = hf_target_url.replace("https://", f"https://{username}:{hf_token}@")
214
 
215
  # مرحله 1: آماده‌سازی فایل‌ها (دانلود یا استخراج زیپ)
@@ -220,7 +221,7 @@ with tab2:
220
  st.error(f"خطا در کلون کردن ریپازیتوری منبع: {msg}")
221
  st.stop()
222
  else:
223
- # اطمینان از دانلود کامل فایل‌های LFS از منبع
224
  run_command(f"git -C {temp_dir_hf} lfs pull")
225
  else:
226
  status_area_hf.info("📥 در حال استخراج فایل ZIP...")
@@ -246,6 +247,7 @@ with tab2:
246
 
247
  run_command("git init")
248
  run_command("git lfs install") # فعال‌سازی و راه‌اندازی محلی LFS
 
249
  run_command(f"git remote add origin {auth_hf_url}") # ایجاد ریموت رسمی جهت شناسایی آپلودهای LFS
250
  run_command("git add .")
251
  run_command('git config user.email "bot@transfer.com"')
 
125
 
126
  run_command("git init")
127
  run_command("git lfs install")
128
+ run_command("git config lfs.allowincompletepush true") # نادیده گرفتن خطای عدم دسترسی موقت به فایل‌های LFS
129
  run_command(f"git remote add origin {auth_gh_url}")
130
  run_command("git add .")
131
  run_command('git config user.email "bot@transfer.com"')
 
170
  uploaded_zip_hf = None
171
 
172
  if source_type_hf == "لینک ریپازیتوری (گیت‌هاب و غیره)":
173
+ src_url_hf = st.text_input("لینک ریپازیتوری منبع (مثلاً گیت‌هاب یا یک اسپیس دیگر)",
174
  placeholder="https://github.com/user/repo.git", key="src_url_hf_input")
175
  else:
176
  uploaded_zip_hf = st.file_uploader("آپلود فایل ZIP (منبع)", type=["zip"], key="zip_hf_input")
 
210
  except Exception:
211
  pass
212
 
213
+ # ایجاد آدرس با الگوی معتبر نام‌کاربری و توکن
214
  auth_hf_url = hf_target_url.replace("https://", f"https://{username}:{hf_token}@")
215
 
216
  # مرحله 1: آماده‌سازی فایل‌ها (دانلود یا استخراج زیپ)
 
221
  st.error(f"خطا در کلون کردن ریپازیتوری منبع: {msg}")
222
  st.stop()
223
  else:
224
+ # دانلود کامل تمامی لایبرری‌ها و فایل‌های سیستمی LFS
225
  run_command(f"git -C {temp_dir_hf} lfs pull")
226
  else:
227
  status_area_hf.info("📥 در حال استخراج فایل ZIP...")
 
247
 
248
  run_command("git init")
249
  run_command("git lfs install") # فعال‌سازی و راه‌اندازی محلی LFS
250
+ run_command("git config lfs.allowincompletepush true") # نادیده گرفتن خطای اشاره‌گرهای ناقص فایل‌های LFS
251
  run_command(f"git remote add origin {auth_hf_url}") # ایجاد ریموت رسمی جهت شناسایی آپلودهای LFS
252
  run_command("git add .")
253
  run_command('git config user.email "bot@transfer.com"')