Skip to content

Commit

Permalink
merges.txt in pull
Browse files Browse the repository at this point in the history
  • Loading branch information
ameen-91 committed Nov 29, 2024
1 parent f22fb24 commit a4a319f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions infero/pull/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ def download_model(model: str):
model_url = f"https://huggingface.co/{model}/resolve/main/pytorch_model.bin"
vocab_url = f"https://huggingface.co/{model}/resolve/main/vocab.json"
config_url = f"https://huggingface.co/{model}/raw/main/config.json"
merges_url = f"https://huggingface.co/{model}/raw/main/merges.txt"
output_dir = os.path.join(
get_package_dir(), f"data/models/{sanitize_model_name(model)}"
)
model_path = os.path.join(output_dir, "pytorch_model.bin")
vocab_path = os.path.join(output_dir, "vocab.json")
config_path = os.path.join(output_dir, "config.json")
merges_path = os.path.join(output_dir, "merges.txt")

os.makedirs(output_dir, exist_ok=True)

Expand All @@ -120,6 +122,11 @@ def download_model(model: str):
else:
print_error(f"Failed to download config file for {model}")

if download_file(merges_url, merges_path):
print_success(f"Merges file for {model} downloaded successfully")
else:
print_neutral("Merges file doesn't exist")


def check_model(model: str):

Expand Down

0 comments on commit a4a319f

Please sign in to comment.