fix error when downloading a model for the first time (#2404)

This commit is contained in:
Juan M Uys 2023-05-31 02:07:12 +01:00 committed by GitHub
parent 4715123f55
commit b984a44f47
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -197,7 +197,7 @@ def start_download_threads(file_list, output_folder, start_from_scratch=False, t
def download_model_files(model, branch, links, sha256, output_folder, start_from_scratch=False, threads=1):
# Creating the folder and writing the metadata
if not output_folder.exists():
output_folder.mkdir()
output_folder.mkdir(parents=True, exist_ok=True)
with open(output_folder / 'huggingface-metadata.txt', 'w') as f:
f.write(f'url: https://huggingface.co/{model}\n')
f.write(f'branch: {branch}\n')