aboutsummaryrefslogtreecommitdiff
path: root/download-pth.py
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-03-23 22:32:02 +0200
committerGeorgi Gerganov <ggerganov@gmail.com>2023-03-23 22:32:21 +0200
commit0ba5a3a9a5efedb1aeecbbc70a4e9825542472d5 (patch)
treecf46ef78b598a123d6116c6d8689208135b71785 /download-pth.py
parent2e17dfd80a473099dacc0f41c9146d233c6a5972 (diff)
Obsolete
Diffstat (limited to 'download-pth.py')
-rw-r--r--download-pth.py66
1 files changed, 0 insertions, 66 deletions
diff --git a/download-pth.py b/download-pth.py
deleted file mode 100644
index 129532c..0000000
--- a/download-pth.py
+++ /dev/null
@@ -1,66 +0,0 @@
-import os
-import sys
-from tqdm import tqdm
-import requests
-
-if len(sys.argv) < 3:
- print("Usage: download-pth.py dir-model model-type\n")
- print(" model-type: Available models 7B, 13B, 30B or 65B")
- sys.exit(1)
-
-modelsDir = sys.argv[1]
-model = sys.argv[2]
-
-num = {
- "7B": 1,
- "13B": 2,
- "30B": 4,
- "65B": 8,
-}
-
-if model not in num:
- print(f"Error: model {model} is not valid, provide 7B, 13B, 30B or 65B")
- sys.exit(1)
-
-print(f"Downloading model {model}")
-
-files = ["checklist.chk", "params.json"]
-
-for i in range(num[model]):
- files.append(f"consolidated.0{i}.pth")
-
-resolved_path = os.path.abspath(os.path.join(modelsDir, model))
-os.makedirs(resolved_path, exist_ok=True)
-
-for file in files:
- dest_path = os.path.join(resolved_path, file)
-
- if os.path.exists(dest_path):
- print(f"Skip file download, it already exists: {file}")
- continue
-
- url = f"https://agi.gpt4.org/llama/LLaMA/{model}/{file}"
- response = requests.get(url, stream=True)
- with open(dest_path, 'wb') as f:
- with tqdm(unit='B', unit_scale=True, miniters=1, desc=file) as t:
- for chunk in response.iter_content(chunk_size=1024):
- if chunk:
- f.write(chunk)
- t.update(len(chunk))
-
-files2 = ["tokenizer_checklist.chk", "tokenizer.model"]
-for file in files2:
- dest_path = os.path.join(modelsDir, file)
-
- if os.path.exists(dest_path):
- print(f"Skip file download, it already exists: {file}")
- continue
-
- url = f"https://agi.gpt4.org/llama/LLaMA/{file}"
- response = requests.get(url, stream=True)
- with open(dest_path, 'wb') as f:
- with tqdm(unit='B', unit_scale=True, miniters=1, desc=file) as t:
- for chunk in response.iter_content(chunk_size=1024):
- if chunk:
- f.write(chunk)
- t.update(len(chunk)) \ No newline at end of file