Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import pandas as pd
|
3 |
+
|
4 |
+
|
5 |
+
block = gr.Blocks()
|
6 |
+
|
7 |
+
def make_clickable_model(model_name, link=None):
|
8 |
+
name = model_name.replace("https://huggingface.co/spaces/","")
|
9 |
+
return f'<a target="_blank" href="{model_name}">{name.split("/")[-1].replace("_", " ")}</a>'
|
10 |
+
|
11 |
+
def read_df():
|
12 |
+
df = pd.read_excel("demo_df.xlsx")
|
13 |
+
links = []
|
14 |
+
for i in range(df.shape[0]):
|
15 |
+
links.append(make_clickable_model(df.iloc[i, 2]))
|
16 |
+
df.drop(columns="Link", inplace=True)
|
17 |
+
df.insert(2, "Link", links)
|
18 |
+
df.insert(0, "ID", list(range(1, len(df) + 1)))
|
19 |
+
return df
|
20 |
+
|
21 |
+
with block:
|
22 |
+
gr.Markdown(
|
23 |
+
"""# Detomo AI Galary 🧙♀️ 🧛♀️ 🤖 """
|
24 |
+
)
|
25 |
+
galary = gr.Dataframe(
|
26 |
+
type="pandas", datatype=["number", "str", "str", "markdown"]
|
27 |
+
)
|
28 |
+
block.load(read_df, inputs=None, outputs=galary)
|
29 |
+
block.launch(share=True, debug=True)
|