File size: 526 Bytes
1797aaf |
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 |
# my_table_app_gradio.py
import gradio as gr
import pandas as pd
def display_table():
# Create a sample dataframe
data = {
"Model": ["ModelA", "ModelB", "ModelC"],
"Score": [0.92, 0.85, 0.89],
"Quantized Score": [0.91, 0.84, 0.88]
}
df = pd.DataFrame(data)
# Convert the DataFrame to an HTML table string
html_table = df.to_html()
return html_table
# Create Gradio interface
iface = gr.Interface(fn=display_table, live=True, inputs=[], outputs="html")
iface.launch()
|