Spaces:
Running
Running
Commit
·
5fc27c0
1
Parent(s):
6d21038
disable large file upload
Browse files
app.py
CHANGED
|
@@ -1196,25 +1196,25 @@ def setup_periodic_tasks():
|
|
| 1196 |
print(f"Download/unzip/incremental update cache_audios.zip failed: {e}")
|
| 1197 |
|
| 1198 |
# 2. 打包本地cache_audios目录为zip
|
| 1199 |
-
if os.path.exists(PRELOAD_CACHE_DIR):
|
| 1200 |
-
|
| 1201 |
-
|
| 1202 |
-
|
| 1203 |
-
|
| 1204 |
-
|
| 1205 |
-
|
| 1206 |
-
|
| 1207 |
-
|
| 1208 |
-
|
| 1209 |
-
|
| 1210 |
-
|
| 1211 |
-
|
| 1212 |
-
|
| 1213 |
-
|
| 1214 |
-
|
| 1215 |
-
|
| 1216 |
-
|
| 1217 |
-
|
| 1218 |
except Exception as e:
|
| 1219 |
print(f"Error syncing cache_audios.zip with HF: {e}")
|
| 1220 |
app.logger.error(f"Error syncing cache_audios.zip with HF: {e}")
|
|
|
|
| 1196 |
print(f"Download/unzip/incremental update cache_audios.zip failed: {e}")
|
| 1197 |
|
| 1198 |
# 2. 打包本地cache_audios目录为zip
|
| 1199 |
+
# if os.path.exists(PRELOAD_CACHE_DIR):
|
| 1200 |
+
# # 先删除旧的zip
|
| 1201 |
+
# if os.path.exists(cache_zip_local_path):
|
| 1202 |
+
# os.remove(cache_zip_local_path)
|
| 1203 |
+
# shutil.make_archive(cache_zip_local_path.replace('.zip', ''), 'zip', PRELOAD_CACHE_DIR)
|
| 1204 |
+
# print(f"Packed {PRELOAD_CACHE_DIR} to {cache_zip_local_path}")
|
| 1205 |
+
#
|
| 1206 |
+
# # 3. 上传zip到HF
|
| 1207 |
+
# print(f"Uploading {cache_zip_local_path} to HF as {cache_zip_remote_path} ...")
|
| 1208 |
+
# api.upload_file(
|
| 1209 |
+
# path_or_fileobj=cache_zip_local_path,
|
| 1210 |
+
# path_in_repo=cache_zip_remote_path,
|
| 1211 |
+
# repo_id=REFERENCE_AUDIO_DATASET,
|
| 1212 |
+
# repo_type="dataset",
|
| 1213 |
+
# commit_message="Upload full cache_audios.zip"
|
| 1214 |
+
# )
|
| 1215 |
+
# print("Upload cache_audios.zip done.")
|
| 1216 |
+
# # 上传后可删除本地zip
|
| 1217 |
+
# os.remove(cache_zip_local_path)
|
| 1218 |
except Exception as e:
|
| 1219 |
print(f"Error syncing cache_audios.zip with HF: {e}")
|
| 1220 |
app.logger.error(f"Error syncing cache_audios.zip with HF: {e}")
|