Spaces:
Running
Running
leadingbridge
commited on
Commit
•
34dad03
1
Parent(s):
f73989d
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import pandas as pd
|
3 |
+
|
4 |
+
def display_csv(file):
|
5 |
+
# Read the CSV file
|
6 |
+
df = pd.read_csv(file.name)
|
7 |
+
# Return the DataFrame to Gradio for display
|
8 |
+
return df
|
9 |
+
|
10 |
+
# Create a Gradio interface
|
11 |
+
interface = gr.Interface(
|
12 |
+
fn=display_csv,
|
13 |
+
inputs="file",
|
14 |
+
outputs="dataframe",
|
15 |
+
title="CSV Viewer",
|
16 |
+
description="Upload a CSV file and view its contents."
|
17 |
+
)
|
18 |
+
|
19 |
+
# Run the interface
|
20 |
+
interface.launch()
|