YchKhan commited on
Commit
d18f2c5
1 Parent(s): cc58222

Update excel_chat.py

Browse files
Files changed (1) hide show
  1. excel_chat.py +2 -1
excel_chat.py CHANGED
@@ -51,8 +51,9 @@ def chat_with_mistral(source_cols, dest_col, prompt, tdoc_name, excel_file, url)
51
 
52
 
53
  def get_columns(file):
 
54
  if file is not None:
55
  df = pd.read_excel(file)
56
- return gr.update(choices=list(df.columns)), gr.update(choices=list(df.columns)), gr.update(choices=list(df.columns)), gr.update(choices=list(df.columns)), df.head(5)
57
  else:
58
  return gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), pd.DataFrame()
 
51
 
52
 
53
  def get_columns(file):
54
+ columns = list(df.columns)
55
  if file is not None:
56
  df = pd.read_excel(file)
57
+ return gr.update(choices=columns), gr.update(choices=columns), gr.update(choices=columns), gr.update(columns.append("")), df.head(5)
58
  else:
59
  return gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), pd.DataFrame()