CLIP-benchmarks / app.py
Jesse-marqo's picture
Create app.py
98b6ea5 verified
raw
history blame
No virus
672 Bytes
import gradio as gr
import pandas as pd
def display_csv(file_path):
# Load the CSV file using pandas
df = pd.read_csv(file_path)
# Convert the dataframe to HTML table
html_table = df.to_html(index=False)
return html_table
# Hardcoded file path
file_path = "merged-averaged-model_timings_2.1.0_12.1_NVIDIA_A10G_False.csv"
# Call the display_csv function with the hardcoded file path
html_table_output = display_csv(file_path)
# Define the output component
output_text = gr.outputs.HTML(label="CSV File Preview")
# Create the Gradio interface
gr.Interface(fn=lambda: html_table_output, inputs=None, outputs=output_text, title="CSV Viewer").launch()