File size: 843 Bytes
e8baafb
d076f2a
0ca1004
 
 
404c329
e8baafb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import gradio as gr
from huggingface_hub import HfApi
token = ""
name = "Omnibus"
api = HfApi(token=token)



def find_dataset(author=None):
    if author == None:
        author=name
    s_ist = (api.list_datasets(author=author,search="ai-tube"))
    #print(api.whoami())
    spaces=[]
    
    for space in s_ist:
    #for i,space in enumerate(s_ist):
        try:
            space_ea = space.id.split("/",1)[1]
            
            spaces.append(space_ea)
            
            print(space.id)
        except Exception as e:
            print(e)
        #s_info=api.space_info(f'{name}/{space}',files_metadata=True)
        #print(s_info)
    print(spaces)
    return(spaces)
with gr.Blocks() as app:
    author = gr.Textbox()
    button = gr.Button()
    output = gr.HTML()
    button.click(find_dataset,author,output)
app.launch()