Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -110,7 +110,7 @@ if (runModel=='1'):
|
|
110 |
api = HfApi()
|
111 |
create_repo(repo_id=repo_name, token=api_token, exist_ok=True)
|
112 |
|
113 |
-
|
114 |
# Create an instance of the custom loss function
|
115 |
training_args = TrainingArguments(
|
116 |
output_dir=f'{repo_name}/results_' + modelNameToUse,
|
@@ -198,7 +198,11 @@ if (runModel=='1'):
|
|
198 |
# Save the model and tokenizer locally
|
199 |
local_model_path = "./data-timeframe_model"
|
200 |
local_tokenizer_path = "./data-timeframe_tokenizer"
|
201 |
-
|
|
|
|
|
|
|
|
|
202 |
model.save_pretrained(local_model_path)
|
203 |
tokenizer.save_pretrained(local_tokenizer_path)
|
204 |
|
|
|
110 |
api = HfApi()
|
111 |
create_repo(repo_id=repo_name, token=api_token, exist_ok=True)
|
112 |
|
113 |
+
|
114 |
# Create an instance of the custom loss function
|
115 |
training_args = TrainingArguments(
|
116 |
output_dir=f'{repo_name}/results_' + modelNameToUse,
|
|
|
198 |
# Save the model and tokenizer locally
|
199 |
local_model_path = "./data-timeframe_model"
|
200 |
local_tokenizer_path = "./data-timeframe_tokenizer"
|
201 |
+
|
202 |
+
# Ensure the directories exist
|
203 |
+
os.makedirs(local_model_path, exist_ok=True)
|
204 |
+
os.makedirs(local_tokenizer_path, exist_ok=True)
|
205 |
+
|
206 |
model.save_pretrained(local_model_path)
|
207 |
tokenizer.save_pretrained(local_tokenizer_path)
|
208 |
|