ZennyKenny commited on
Commit
63651ec
Β·
verified Β·
1 Parent(s): 121b893

reset file pointer

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -46,7 +46,8 @@ with gr.Blocks() as nps:
46
 
47
  def load_data(file):
48
  if file is not None:
49
- custom_df = pd.read_csv(file.name)
 
50
  if 'customer_comment' not in custom_df.columns:
51
  return "Error: Uploaded CSV must contain a column named 'customer_comment'"
52
  global df
 
46
 
47
  def load_data(file):
48
  if file is not None:
49
+ file.seek(0) # Reset file pointer
50
+ custom_df = pd.read_csv(file)
51
  if 'customer_comment' not in custom_df.columns:
52
  return "Error: Uploaded CSV must contain a column named 'customer_comment'"
53
  global df