Reyad-Ahmmed commited on
Commit
36150aa
·
verified ·
1 Parent(s): a57bfeb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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