Spaces:
Sleeping
Sleeping
Update excel_chat.py
Browse files- excel_chat.py +3 -2
excel_chat.py
CHANGED
@@ -97,6 +97,7 @@ def chat_with_mistral(source_cols, dest_col, prompt, excel_file, url, search_col
|
|
97 |
def get_columns(file,progress=gr.Progress()):
|
98 |
if file is not None:
|
99 |
df = pd.read_excel(file)
|
100 |
-
|
|
|
101 |
else:
|
102 |
-
return gr.update(choices=[]), gr.update(choices=[]), pd.DataFrame()
|
|
|
97 |
def get_columns(file,progress=gr.Progress()):
|
98 |
if file is not None:
|
99 |
df = pd.read_excel(file)
|
100 |
+
columns = list(df.columns)
|
101 |
+
return gr.update(choices=columns), gr.update(choices=columns), gr.update(choices=columns), gr.update(choices=columns + [""]), gr.update(choices=columns + ['[ALL]']), df.head(5)
|
102 |
else:
|
103 |
+
return gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), pd.DataFrame()
|