Added info if model already downloaded in --list_models

pull/3/head
Thorsten Mueller 2021-01-27 16:19:02 +01:00
parent df5899daf4
commit c75ea74914
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.