Skip to content

Commit

Permalink
use load_file_from_url with named parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
viking1304 committed Mar 11, 2024
1 parent e7f0625 commit 8da9db0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/deforum_helpers/frame_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def check_and_download_film_model(model_name, model_dest_folder):
try:
os.makedirs(model_dest_folder, exist_ok=True)
# download film model from url
load_file_from_url(download_url, model_dest_folder)
load_file_from_url(url=download_url, model_dir=model_dest_folder)
# verify checksum
if checksum(model_dest_path) != film_model_hash:
raise Exception(f"Error while downloading {model_name}. Please download from: {download_url}, and put in: {model_dest_folder}")
Expand Down
2 changes: 1 addition & 1 deletion scripts/deforum_helpers/src/rife/rife_new_gen/RIFE_HDv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ def download_rife_model(path, deforum_models_path):
except:
print("Try to fallback to basicsr with older modules")
from basicsr.utils.download_util import load_file_from_url
load_file_from_url(options[path][1], deforum_models_path)
load_file_from_url(url=options[path][1], model_dir=deforum_models_path)
if checksum(target_path) != options[path][0]:
raise Exception(f"Error while downloading {target_file}. Please download from here: {options[path][1]} and place in: " + deforum_models_path)
2 changes: 1 addition & 1 deletion scripts/deforum_helpers/upscaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def check_and_download_realesrgan_ncnn(models_folder, current_user_os):
try:
os.makedirs(realesrgan_ncnn_folder, exist_ok=True)
# download exec and model files from url
load_file_from_url(download_url, realesrgan_ncnn_folder)
load_file_from_url(url=download_url, model_dir=realesrgan_ncnn_folder)
# check downloaded zip's hash
with open(realesrgan_zip_path, 'rb') as f:
file_hash = checksum(realesrgan_zip_path)
Expand Down
2 changes: 1 addition & 1 deletion scripts/deforum_helpers/video_audio_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def check_and_download_gifski(models_folder, current_user_os):
file_path = os.path.join(models_folder, file_name)

if not os.path.exists(file_path):
load_file_from_url(download_url, models_folder)
load_file_from_url(url=download_url, model_dir=models_folder)
if current_user_os in ['Linux','Mac']:
os.chmod(file_path, 0o755)
if current_user_os == 'Mac':
Expand Down

0 comments on commit 8da9db0

Please sign in to comment.