mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-26 01:30:20 +01:00
Don't override the metadata when checking the sha256sum
This commit is contained in:
parent
b99bea3c69
commit
74462ac713
@ -197,20 +197,7 @@ if __name__ == '__main__':
|
|||||||
output_folder = f"{'_'.join(model.split('/')[-2:])}"
|
output_folder = f"{'_'.join(model.split('/')[-2:])}"
|
||||||
if branch != 'main':
|
if branch != 'main':
|
||||||
output_folder += f'_{branch}'
|
output_folder += f'_{branch}'
|
||||||
|
|
||||||
# Creating the folder and writing the metadata
|
|
||||||
output_folder = Path(base_folder) / output_folder
|
output_folder = Path(base_folder) / output_folder
|
||||||
if not output_folder.exists():
|
|
||||||
output_folder.mkdir()
|
|
||||||
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')
|
|
||||||
f.write(f'download date: {str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))}\n')
|
|
||||||
sha256_str = ''
|
|
||||||
for i in range(len(sha256)):
|
|
||||||
sha256_str += f' {sha256[i][1]} {sha256[i][0]}\n'
|
|
||||||
if sha256_str != '':
|
|
||||||
f.write(f'sha256sum:\n{sha256_str}')
|
|
||||||
|
|
||||||
if args.check:
|
if args.check:
|
||||||
# Validate the checksums
|
# Validate the checksums
|
||||||
@ -238,6 +225,20 @@ if __name__ == '__main__':
|
|||||||
print('[-] Invalid checksums. Rerun download-model.py with the --clean flag.')
|
print('[-] Invalid checksums. Rerun download-model.py with the --clean flag.')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
# Creating the folder and writing the metadata
|
||||||
|
if not output_folder.exists():
|
||||||
|
output_folder.mkdir()
|
||||||
|
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')
|
||||||
|
f.write(f'download date: {str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))}\n')
|
||||||
|
sha256_str = ''
|
||||||
|
for i in range(len(sha256)):
|
||||||
|
sha256_str += f' {sha256[i][1]} {sha256[i][0]}\n'
|
||||||
|
if sha256_str != '':
|
||||||
|
f.write(f'sha256sum:\n{sha256_str}')
|
||||||
|
|
||||||
# Downloading the files
|
# Downloading the files
|
||||||
print(f"Downloading the model to {output_folder}")
|
print(f"Downloading the model to {output_folder}")
|
||||||
download_files(links, output_folder, args.threads)
|
download_files(links, output_folder, args.threads)
|
Loading…
Reference in New Issue
Block a user