Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
import random
|
3 |
-
|
4 |
-
from datasets import load_dataset
|
5 |
from datasets import config
|
6 |
import os
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
dataset = load_dataset("Vchitect/VBench_sampled_video")
|
12 |
# print(os.listdir("~/.cache/huggingface/datasets/Vchitect___VBench_sampled_video/"))
|
13 |
# root = "~/.cache/huggingface/datasets/Vchitect___VBench_sampled_video/"
|
14 |
-
print(config.HF_DATASETS_CACHE)
|
15 |
-
root = config.HF_DATASETS_CACHE
|
16 |
-
print(root)
|
17 |
def print_directory_contents(path, indent=0):
|
18 |
# 打印当前目录的内容
|
19 |
try:
|
@@ -25,9 +25,6 @@ def print_directory_contents(path, indent=0):
|
|
25 |
except PermissionError:
|
26 |
print(' ' * indent + "[权限错误,无法访问该目录]")
|
27 |
|
28 |
-
# 调用函数,传入你想要打印的目录路径
|
29 |
-
print_directory_contents(root) # 替换为实际路径
|
30 |
-
# local_dir =
|
31 |
|
32 |
# 克隆数据集
|
33 |
submission_repo = Repository(local_dir=local_dir, clone_from=submission_url, use_auth_token=hf_token, repo_type="dataset")
|
|
|
1 |
import gradio as gr
|
2 |
import random
|
3 |
+
from huggingface_hub import Repository
|
4 |
+
# from datasets import load_dataset
|
5 |
from datasets import config
|
6 |
import os
|
7 |
|
8 |
+
hf_token = os.environ['hf_token'] # 确保环境变量中有你的令牌
|
9 |
+
submission_url = "Vchitect/VBench_sampled_video" # 数据集的 URL
|
10 |
+
local_dir = "VBench_sampled_video" # 本地文件夹路径
|
11 |
+
# dataset = load_dataset("Vchitect/VBench_sampled_video")
|
12 |
# print(os.listdir("~/.cache/huggingface/datasets/Vchitect___VBench_sampled_video/"))
|
13 |
# root = "~/.cache/huggingface/datasets/Vchitect___VBench_sampled_video/"
|
14 |
+
# print(config.HF_DATASETS_CACHE)
|
15 |
+
# root = config.HF_DATASETS_CACHE
|
16 |
+
# print(root)
|
17 |
def print_directory_contents(path, indent=0):
|
18 |
# 打印当前目录的内容
|
19 |
try:
|
|
|
25 |
except PermissionError:
|
26 |
print(' ' * indent + "[权限错误,无法访问该目录]")
|
27 |
|
|
|
|
|
|
|
28 |
|
29 |
# 克隆数据集
|
30 |
submission_repo = Repository(local_dir=local_dir, clone_from=submission_url, use_auth_token=hf_token, repo_type="dataset")
|