File size: 672 Bytes
98b6ea5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()