pratikshahp commited on
Commit
b7a73b1
·
verified ·
1 Parent(s): 200964c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import pandas as pd
3
+
4
+ # Function to read CSV and return its content
5
+ def read_csv(file):
6
+ # Read the CSV file using pandas
7
+ df = pd.read_csv(file.name)
8
+ return df
9
+
10
+ # Create the Gradio interface
11
+ interface = gr.Interface(
12
+ fn=read_csv,
13
+ inputs=gr.File(label="Upload CSV File", type="file"),
14
+ outputs="dataframe", # Display the content as a dataframe
15
+ title="CSV Viewer",
16
+ description="Upload a CSV file, and the app will display its content."
17
+ )
18
+
19
+ # Launch the interface
20
+ interface.launch()