Spaces:
Running
Running
Model save now checks and makes a folder before writing the model
Browse files
funcs/helper_functions.py
CHANGED
@@ -195,7 +195,14 @@ def save_topic_outputs(topic_model, data_file_name_no_ext, output_list, docs, sa
|
|
195 |
# Save topic model to file
|
196 |
if save_topic_model == "Yes":
|
197 |
print("Saving BERTopic model in .pkl format.")
|
198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
topic_model_save_name_zip = topic_model_save_name_pkl + ".zip"
|
200 |
|
201 |
# Clear folder before replacing files
|
|
|
195 |
# Save topic model to file
|
196 |
if save_topic_model == "Yes":
|
197 |
print("Saving BERTopic model in .pkl format.")
|
198 |
+
|
199 |
+
folder_path = "output_model/"
|
200 |
+
|
201 |
+
if not os.path.exists(folder_path):
|
202 |
+
# Create the folder
|
203 |
+
os.makedirs(folder_path)
|
204 |
+
|
205 |
+
topic_model_save_name_pkl = folder_path + data_file_name_no_ext + "_topics_" + today_rev + ".pkl"# + ".safetensors"
|
206 |
topic_model_save_name_zip = topic_model_save_name_pkl + ".zip"
|
207 |
|
208 |
# Clear folder before replacing files
|