Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit aa998ae

Browse files
committed
CU-8698mqu96: Fix TRF-NER output dir typing issue
1 parent efab5ac commit aa998ae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

medcat/ner/transformers_ner.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,11 @@ def train(self,
265265
self.config.general.last_train_on = datetime.now().timestamp() # type: ignore
266266

267267
# Save everything
268-
self.save(save_dir_path=os.path.join(self.training_arguments.output_dir, 'final_model'))
268+
output_dir = self.training_arguments.output_dir
269+
if output_dir is None:
270+
# NOTE: this shouldn't really happen, but we'll do this for type safety
271+
raise ValueError("Output path should not be None!")
272+
self.save(save_dir_path=os.path.join(output_dir, 'final_model'))
269273

270274
# Run an eval step and return metrics
271275
p = trainer.predict(encoded_dataset['test']) # type: ignore

0 commit comments

Comments
 (0)