Spaces:
Sleeping
Sleeping
Update player.py
Browse files
player.py
CHANGED
@@ -11,7 +11,6 @@ def find_dataset(author=""):
|
|
11 |
#print(api.whoami())
|
12 |
channels=[]
|
13 |
videos=[]
|
14 |
-
out_html=""
|
15 |
for space in s_ist:
|
16 |
try:
|
17 |
channels.append(space.id)
|
@@ -20,6 +19,7 @@ def find_dataset(author=""):
|
|
20 |
return (gr.Dropdown(label="Channels", choices=[s for s in channels],interactive=True))
|
21 |
|
22 |
def load_vid(channel):
|
|
|
23 |
try:
|
24 |
file_box = [info.path for info in list_files_info(f'{channel}', repo_type="dataset")]
|
25 |
ai_tube_box = [info.path for info in list_files_info(f'{source_dataset}', repo_type="dataset")]
|
@@ -55,9 +55,9 @@ def load_vid(channel):
|
|
55 |
print(e)
|
56 |
return(out_html)
|
57 |
with gr.Blocks() as app:
|
58 |
-
|
59 |
button = gr.Button()
|
60 |
output = gr.HTML()
|
61 |
-
app.load(find_dataset,None,
|
62 |
-
|
63 |
app.launch(show_api=False,share=False)
|
|
|
11 |
#print(api.whoami())
|
12 |
channels=[]
|
13 |
videos=[]
|
|
|
14 |
for space in s_ist:
|
15 |
try:
|
16 |
channels.append(space.id)
|
|
|
19 |
return (gr.Dropdown(label="Channels", choices=[s for s in channels],interactive=True))
|
20 |
|
21 |
def load_vid(channel):
|
22 |
+
out_html=""
|
23 |
try:
|
24 |
file_box = [info.path for info in list_files_info(f'{channel}', repo_type="dataset")]
|
25 |
ai_tube_box = [info.path for info in list_files_info(f'{source_dataset}', repo_type="dataset")]
|
|
|
55 |
print(e)
|
56 |
return(out_html)
|
57 |
with gr.Blocks() as app:
|
58 |
+
channel = gr.Dropdown()
|
59 |
button = gr.Button()
|
60 |
output = gr.HTML()
|
61 |
+
app.load(find_dataset,None,channel)
|
62 |
+
channel.change(load_vid,channel,output)
|
63 |
app.launch(show_api=False,share=False)
|