Pro-Coder commited on
Commit
1eb3e75
·
verified ·
1 Parent(s): f08fae8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ def analyze_single(text):
8
  return result, summary, wc_img
9
 
10
  def analyze_batch(file):
11
- df = pd.read_csv(file.name)
12
  results = []
13
  summaries = []
14
  combined_text = ""
@@ -39,7 +39,7 @@ with gr.Blocks() as demo:
39
  btn.click(analyze_single, inputs=inp, outputs=[out1, out2, out3])
40
 
41
  with gr.Tab("Batch Upload (CSV)"):
42
- file_in = gr.File(label="Upload CSV with 'comment' column", type="file")
43
  df_out = gr.Dataframe(label="Analysis Results")
44
  wc_out = gr.Image(label="Word Cloud")
45
  file_in.change(analyze_batch, inputs=file_in, outputs=[df_out, wc_out])
 
8
  return result, summary, wc_img
9
 
10
  def analyze_batch(file):
11
+ df = pd.read_csv(file_path)
12
  results = []
13
  summaries = []
14
  combined_text = ""
 
39
  btn.click(analyze_single, inputs=inp, outputs=[out1, out2, out3])
40
 
41
  with gr.Tab("Batch Upload (CSV)"):
42
+ file_in = gr.File(label="Upload CSV with 'comment' column", type="filepath")
43
  df_out = gr.Dataframe(label="Analysis Results")
44
  wc_out = gr.Image(label="Word Cloud")
45
  file_in.change(analyze_batch, inputs=file_in, outputs=[df_out, wc_out])