vivek9 commited on
Commit
8c68262
·
verified ·
1 Parent(s): 1a4c084

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,11 +5,12 @@ import io
5
  def read_csv(csv_file):
6
  # Convert uploaded file data to pandas DataFrame
7
  df = pd.read_csv(csv_file.name)
8
- return df
 
9
 
10
  iface = gr.Interface(fn=read_csv,
11
  inputs=gr.File(label="Upload CSV file"),
12
- outputs="dataframe",
13
  title="CSV File Reader",
14
  description="Upload a CSV file and read its contents.")
15
  iface.launch(debug=True)
 
5
  def read_csv(csv_file):
6
  # Convert uploaded file data to pandas DataFrame
7
  df = pd.read_csv(csv_file.name)
8
+ df.to_csv("result.csv")
9
+ return df,"result.csv"
10
 
11
  iface = gr.Interface(fn=read_csv,
12
  inputs=gr.File(label="Upload CSV file"),
13
+ outputs=["dataframe",gr.File(label="result")],
14
  title="CSV File Reader",
15
  description="Upload a CSV file and read its contents.")
16
  iface.launch(debug=True)