Merge pull request #628 from thorstenMueller/dev

Added info if model already downloaded in --list_models
This commit is contained in:
Eren Gölge 2021-01-28 13:10:06 +01:00 committed by GitHub
commit 131a163c95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -52,7 +52,12 @@ class ModelManager(object):
for lang in self.models_dict[model_type]:
for dataset in self.models_dict[model_type][lang]:
for model in self.models_dict[model_type][lang][dataset]:
print(f" >: {model_type}/{lang}/{dataset}/{model} ")
model_full_name = f"{model_type}--{lang}--{dataset}--{model}"
output_path = os.path.join(self.output_prefix, model_full_name)
if os.path.exists(output_path):
print(f" >: {model_type}/{lang}/{dataset}/{model} [already downloaded]")
else:
print(f" >: {model_type}/{lang}/{dataset}/{model}")
def download_model(self, model_name):
"""Download model files given the full model name.