Make the validate vs train decision based on the existance of cls_last.pth istead of a model directory

This commit is contained in:
Piotr Czapla
2019-02-15 01:17:53 +01:00
parent 5dced1e488
commit 8733487d55
+1 -1
View File
@@ -47,7 +47,7 @@ class ULMFiT:
for lang, dataset_path in sorted(get_dataset_path(base_model, dataset_template)):
params = CLSHyperParams.from_lm(dataset_path, base_model, lang=lang, name=name, cuda_id=cuda_id)
key = str(params.model_dir.relative_to(Path.cwd()))
if params.model_dir.exists():
if (params.model_dir/"cls_last.pth").exists():
print("Evaluating previously trained model")
results[key] = params.validate_cls()[1]
else: