File size: 897 Bytes
55bc4d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
import pandas as pd


block = gr.Blocks()

def make_clickable_model(model_name, link=None):
    name = model_name.replace("https://huggingface.co/spaces/","")
    return f'<a target="_blank" href="{model_name}">{name.split("/")[-1].replace("_", " ")}</a>'

def read_df():
    df = pd.read_excel("demo_df.xlsx")
    links = []
    for i in range(df.shape[0]):
        links.append(make_clickable_model(df.iloc[i, 2]))
    df.drop(columns="Link", inplace=True)
    df.insert(2, "Link", links)
    df.insert(0, "ID", list(range(1, len(df) + 1)))
    return df

with block:
    gr.Markdown(
        """# Detomo AI Galary  🧙‍♀️ 🧛‍♀️ 🤖  """
    )
    galary = gr.Dataframe(
                    type="pandas", datatype=["number", "str", "str", "markdown"]
                )
    block.load(read_df, inputs=None, outputs=galary)
block.launch(share=True, debug=True)