Spaces:
Runtime error
Runtime error
Update run.py
Browse files
run.py
CHANGED
@@ -8,8 +8,8 @@ dataset_options = [
|
|
8 |
"OpenVideo/pexels-raw",
|
9 |
"OpenVideo/Sample-2k",
|
10 |
]
|
11 |
-
|
12 |
-
|
13 |
|
14 |
def login(token):
|
15 |
u = HFUser.from_token(token)
|
@@ -21,8 +21,8 @@ def show_time(u, name):
|
|
21 |
def list_dataset(u, repo):
|
22 |
print(f"repo is: {repo}")
|
23 |
files = u.list_dataset(repo)
|
|
|
24 |
fetch_files = files
|
25 |
-
fetch_files_select_idx = 0
|
26 |
return gr.Dropdown(value=files[0], choices=files), gr.Column(visible=True), gr.Column(visible=False)
|
27 |
|
28 |
def fetch_parquet(u, fname):
|
@@ -56,6 +56,8 @@ def next_chunks(video_chunks, epoch_idx):
|
|
56 |
return (epoch_idx+1)%length, gr.Slider(value=0)
|
57 |
|
58 |
def next_mp4_chunks(video_chunks, epoch_idx):
|
|
|
|
|
59 |
return gr.Dropdown(value=fetch_files[fetch_files_select_idx + 1], choices=fetch_files)
|
60 |
|
61 |
with gr.Blocks(**GR_CONF) as Core:
|
|
|
8 |
"OpenVideo/pexels-raw",
|
9 |
"OpenVideo/Sample-2k",
|
10 |
]
|
11 |
+
fetch_files = []
|
12 |
+
fetch_files_select_idx = 0
|
13 |
|
14 |
def login(token):
|
15 |
u = HFUser.from_token(token)
|
|
|
21 |
def list_dataset(u, repo):
|
22 |
print(f"repo is: {repo}")
|
23 |
files = u.list_dataset(repo)
|
24 |
+
global fetch_files
|
25 |
fetch_files = files
|
|
|
26 |
return gr.Dropdown(value=files[0], choices=files), gr.Column(visible=True), gr.Column(visible=False)
|
27 |
|
28 |
def fetch_parquet(u, fname):
|
|
|
56 |
return (epoch_idx+1)%length, gr.Slider(value=0)
|
57 |
|
58 |
def next_mp4_chunks(video_chunks, epoch_idx):
|
59 |
+
global fetch_files_select_idx
|
60 |
+
fetch_files_select_idx = fetch_files_select_idx + 1
|
61 |
return gr.Dropdown(value=fetch_files[fetch_files_select_idx + 1], choices=fetch_files)
|
62 |
|
63 |
with gr.Blocks(**GR_CONF) as Core:
|