Spaces:
Sleeping
Sleeping
Update player.py
Browse files
player.py
CHANGED
@@ -1,22 +1,35 @@
|
|
|
|
1 |
from huggingface_hub import HfApi
|
2 |
token = ""
|
3 |
name = "Omnibus"
|
4 |
api = HfApi(token=token)
|
5 |
-
author=name
|
6 |
-
s_ist = (api.list_datasets(author=author,search="ai-tube"))
|
7 |
-
#print(api.whoami())
|
8 |
-
spaces=[]
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
#
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
from huggingface_hub import HfApi
|
3 |
token = ""
|
4 |
name = "Omnibus"
|
5 |
api = HfApi(token=token)
|
|
|
|
|
|
|
|
|
6 |
|
7 |
+
|
8 |
+
|
9 |
+
def find_dataset(author=None):
|
10 |
+
if author == None:
|
11 |
+
author=name
|
12 |
+
s_ist = (api.list_datasets(author=author,search="ai-tube"))
|
13 |
+
#print(api.whoami())
|
14 |
+
spaces=[]
|
15 |
+
|
16 |
+
for space in s_ist:
|
17 |
+
#for i,space in enumerate(s_ist):
|
18 |
+
try:
|
19 |
+
space_ea = space.id.split("/",1)[1]
|
20 |
+
|
21 |
+
spaces.append(space_ea)
|
22 |
+
|
23 |
+
print(space.id)
|
24 |
+
except Exception as e:
|
25 |
+
print(e)
|
26 |
+
#s_info=api.space_info(f'{name}/{space}',files_metadata=True)
|
27 |
+
#print(s_info)
|
28 |
+
print(spaces)
|
29 |
+
return(spaces)
|
30 |
+
with gr.Blocks() as app:
|
31 |
+
author = gr.Textbox()
|
32 |
+
button = gr.Button()
|
33 |
+
output = gr.HTML()
|
34 |
+
button.click(find_dataset,author,output)
|
35 |
+
app.launch()
|