Spaces:
Sleeping
Sleeping
Update excel_chat.py
Browse files- excel_chat.py +5 -3
excel_chat.py
CHANGED
@@ -7,6 +7,7 @@ import numpy as np
|
|
7 |
from groq import Groq
|
8 |
import anthropic
|
9 |
from users_management import update_json, users
|
|
|
10 |
|
11 |
#users = ['maksG', 'AlmaA', 'YchK']
|
12 |
|
@@ -114,8 +115,9 @@ def chat_with_mistral(source_cols, dest_col, prompt, excel_file, url, search_col
|
|
114 |
|
115 |
def get_columns(file,progress=gr.Progress()):
|
116 |
if file is not None:
|
117 |
-
df = pd.read_excel(file)
|
|
|
118 |
columns = list(df.columns)
|
119 |
-
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)
|
120 |
else:
|
121 |
-
return gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), pd.DataFrame()
|
|
|
7 |
from groq import Groq
|
8 |
import anthropic
|
9 |
from users_management import update_json, users
|
10 |
+
from code_df_custom import load_excel
|
11 |
|
12 |
#users = ['maksG', 'AlmaA', 'YchK']
|
13 |
|
|
|
115 |
|
116 |
def get_columns(file,progress=gr.Progress()):
|
117 |
if file is not None:
|
118 |
+
#df = pd.read_excel(file)
|
119 |
+
filename, df = load_excel(file)
|
120 |
columns = list(df.columns)
|
121 |
+
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), filename, df
|
122 |
else:
|
123 |
+
return gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), gr.update(choices=[]), pd.DataFrame(), '', pd.DataFrame()
|