Spaces:
Sleeping
Sleeping
quchenyuan
commited on
Commit
•
7fdf6e4
1
Parent(s):
ebb0a81
Update app.py
Browse files
app.py
CHANGED
@@ -52,11 +52,11 @@ def download_video(uuid):
|
|
52 |
storage_dir = Path("videos")
|
53 |
storage_dir.mkdir(exist_ok=True)
|
54 |
|
55 |
-
storage_limit = 40 * 1024 * 1024 * 1024
|
56 |
-
current_storage = sum(f.stat().st_size for f in storage_dir.glob('*') if f.is_file())
|
57 |
-
if current_storage + os.path.getsize(video_filename) > storage_limit:
|
58 |
-
|
59 |
-
|
60 |
|
61 |
downloaded_file_path = hf_hub_download(dataset_name, dataset_path + video_filename)
|
62 |
|
|
|
52 |
storage_dir = Path("videos")
|
53 |
storage_dir.mkdir(exist_ok=True)
|
54 |
|
55 |
+
# storage_limit = 40 * 1024 * 1024 * 1024
|
56 |
+
# current_storage = sum(f.stat().st_size for f in storage_dir.glob('*') if f.is_file())
|
57 |
+
# if current_storage + os.path.getsize(video_filename) > storage_limit:
|
58 |
+
# oldest_file = min(storage_dir.glob('*'), key=os.path.getmtime)
|
59 |
+
# oldest_file.unlink()
|
60 |
|
61 |
downloaded_file_path = hf_hub_download(dataset_name, dataset_path + video_filename)
|
62 |
|