Spaces:
Sleeping
Sleeping
Update excel_chat.py
Browse files- excel_chat.py +2 -4
excel_chat.py
CHANGED
|
@@ -219,7 +219,6 @@ def chat_with_mistral(source_cols, dest_col, prompt, excel_file, url, search_col
|
|
| 219 |
|
| 220 |
filtred_df = filter_df(df, search_col, keywords)
|
| 221 |
|
| 222 |
-
checkpoints_files = []
|
| 223 |
cpt = 1
|
| 224 |
checkpoint = 50
|
| 225 |
for index, row in filtred_df.iterrows():
|
|
@@ -236,8 +235,7 @@ def chat_with_mistral(source_cols, dest_col, prompt, excel_file, url, search_col
|
|
| 236 |
df.at[index, dest_col] = llm_answer
|
| 237 |
|
| 238 |
if cpt == checkpoint:
|
| 239 |
-
df.to_excel(
|
| 240 |
-
checkpoints_files.append(str(cpt))
|
| 241 |
|
| 242 |
checkpoint += 50
|
| 243 |
|
|
@@ -255,7 +253,7 @@ def chat_with_mistral(source_cols, dest_col, prompt, excel_file, url, search_col
|
|
| 255 |
with zipfile.ZipFile(zip_file_path, 'w') as zipf:
|
| 256 |
zipf.write(conf_file_path, os.path.basename(conf_file_path))
|
| 257 |
|
| 258 |
-
return file_name, df.head(5), new_prompts, new_keywords, new_user, zip_file_path,
|
| 259 |
|
| 260 |
|
| 261 |
def get_columns(file,progress=gr.Progress()):
|
|
|
|
| 219 |
|
| 220 |
filtred_df = filter_df(df, search_col, keywords)
|
| 221 |
|
|
|
|
| 222 |
cpt = 1
|
| 223 |
checkpoint = 50
|
| 224 |
for index, row in filtred_df.iterrows():
|
|
|
|
| 235 |
df.at[index, dest_col] = llm_answer
|
| 236 |
|
| 237 |
if cpt == checkpoint:
|
| 238 |
+
df.to_excel("checkpointfile")
|
|
|
|
| 239 |
|
| 240 |
checkpoint += 50
|
| 241 |
|
|
|
|
| 253 |
with zipfile.ZipFile(zip_file_path, 'w') as zipf:
|
| 254 |
zipf.write(conf_file_path, os.path.basename(conf_file_path))
|
| 255 |
|
| 256 |
+
return file_name, df.head(5), new_prompts, new_keywords, new_user, zip_file_path, "checkpoints_file"
|
| 257 |
|
| 258 |
|
| 259 |
def get_columns(file,progress=gr.Progress()):
|