Update app.py
Browse files
app.py
CHANGED
@@ -2,12 +2,9 @@ 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 |
-
|
10 |
-
return f'<button formaction="{model_name}" formtarget="_blank">{name.split("/")[-1].replace("_", " ")}</button>'
|
11 |
|
12 |
def read_df():
|
13 |
df = pd.read_excel("demo_df.xlsx")
|
@@ -19,12 +16,13 @@ def read_df():
|
|
19 |
df.insert(0, "ID", list(range(1, len(df) + 1)))
|
20 |
return df
|
21 |
|
22 |
-
with
|
23 |
gr.Markdown(
|
24 |
"""# Detomo AI Galary 🧙♀️ 🧛♀️ 🤖 """
|
25 |
)
|
26 |
galary = gr.Dataframe(
|
27 |
type="pandas", datatype=["number", "str", "str", "markdown"]
|
28 |
)
|
29 |
-
|
30 |
-
|
|
|
|
2 |
import pandas as pd
|
3 |
|
4 |
|
|
|
|
|
5 |
def make_clickable_model(model_name, link=None):
|
6 |
name = model_name.replace("https://huggingface.co/spaces/","")
|
7 |
+
return f'<a target="_blank" href="{model_name}">{name.split("/")[-1].replace("_", " ")}</a>'
|
|
|
8 |
|
9 |
def read_df():
|
10 |
df = pd.read_excel("demo_df.xlsx")
|
|
|
16 |
df.insert(0, "ID", list(range(1, len(df) + 1)))
|
17 |
return df
|
18 |
|
19 |
+
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
20 |
gr.Markdown(
|
21 |
"""# Detomo AI Galary 🧙♀️ 🧛♀️ 🤖 """
|
22 |
)
|
23 |
galary = gr.Dataframe(
|
24 |
type="pandas", datatype=["number", "str", "str", "markdown"]
|
25 |
)
|
26 |
+
demo.load(read_df, inputs=None, outputs=galary)
|
27 |
+
|
28 |
+
demo.launch()
|