diff --git a/download-model.py b/download-model.py index a83ed17a..220302d9 100644 --- a/download-model.py +++ b/download-model.py @@ -71,7 +71,9 @@ if __name__ == '__main__': for link in links: href = link.get('href')[1:] if href.startswith(f'{model}/resolve/{branch}'): - if href.endswith(('.json', '.txt')) or (href.endswith('.bin') and 'pytorch_model' in href): + is_pytorch = href.endswith('.bin') and 'pytorch_model' in href + is_safetensors = href.endswith('.safetensors') and 'model' in href + if href.endswith(('.json', '.txt')) or is_pytorch or is_safetensors: downloads.append(f'https://huggingface.co/{href}') # Downloading the files diff --git a/requirements.txt b/requirements.txt index e953a7cb..fd747a9e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ deepspeed==0.8.0 gradio==3.15.0 transformers==4.25.1 beautifulsoup4 +safetensors