Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import pandas as pd
|
| 3 |
+
|
| 4 |
+
def upload_file(fp):
|
| 5 |
+
return pd.read_csv(fp).head()
|
| 6 |
+
|
| 7 |
+
with gr.Blocks() as demo:
|
| 8 |
+
file_input = gr.File(label="Upload CSV", type="filepath")
|
| 9 |
+
df_output = gr.DataFrame(label="Preview")
|
| 10 |
+
file_input.change(upload_file, inputs=[file_input], outputs=[df_output])
|
| 11 |
+
demo.launch(debug=True)
|