small changes & meta-llama_Llama-3.2-1B_4e20de362430cd3b72f300e6b0f18e50e7166e08.logits.safetensors
Browse files
compress_weights.bash
CHANGED
@@ -6,12 +6,18 @@
|
|
6 |
LEVEL=-4
|
7 |
#LEVEL=-9
|
8 |
#LEVEL=--adapt=min=1,max=22
|
|
|
|
|
9 |
|
10 |
model_id="$1"
|
11 |
revision="$2"
|
12 |
repo_url=https://huggingface.co/"$model_id"
|
13 |
clonepath="$(basename "$repo_url")"
|
14 |
cachepath="${HOME}/.cache/huggingface/hub/models--${model_id//\//--}/blobs"
|
|
|
|
|
|
|
|
|
15 |
HF_TOKEN="$(<${HOME}/.cache/huggingface/token)"
|
16 |
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/"$1" "$clonepath"
|
17 |
mkdir -p "$cachepath"
|
@@ -28,11 +34,11 @@ do
|
|
28 |
zstd -l "$outfile" && { echo "$file" 1>&3; continue; }
|
29 |
echo
|
30 |
echo "# Recompressing $file #"
|
31 |
-
echo
|
32 |
fi
|
33 |
-
|
|
|
34 |
zstd -l "$outfile"
|
35 |
echo
|
36 |
echo
|
37 |
echo "$file" 1>&3
|
38 |
-
done 3>&1 1>&2 |
|
|
|
6 |
LEVEL=-4
|
7 |
#LEVEL=-9
|
8 |
#LEVEL=--adapt=min=1,max=22
|
9 |
+
PV="pv -cpteabm $((60*60*24))"
|
10 |
+
#PV="pv -cpteab"
|
11 |
|
12 |
model_id="$1"
|
13 |
revision="$2"
|
14 |
repo_url=https://huggingface.co/"$model_id"
|
15 |
clonepath="$(basename "$repo_url")"
|
16 |
cachepath="${HOME}/.cache/huggingface/hub/models--${model_id//\//--}/blobs"
|
17 |
+
if ! [ -e ${HOME}/.cache/huggingface/token ]
|
18 |
+
then
|
19 |
+
huggingface-cli login || exit -1
|
20 |
+
fi
|
21 |
HF_TOKEN="$(<${HOME}/.cache/huggingface/token)"
|
22 |
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/"$1" "$clonepath"
|
23 |
mkdir -p "$cachepath"
|
|
|
34 |
zstd -l "$outfile" && { echo "$file" 1>&3; continue; }
|
35 |
echo
|
36 |
echo "# Recompressing $file #"
|
|
|
37 |
fi
|
38 |
+
echo
|
39 |
+
{ curl -s -L -H "Authorization: Bearer $HF_TOKEN" "$file_url" || exit -1; } | $PV -s "$size" -N "$file" | zstd -q --no-progress --force --size-hint="$size" --stream-size="$size" --ultra --long=31 --memory=2048MB --threads=1024 "$LEVEL" | $PV -s "$((size * 100/129))" -N "$blobname".zst > "$outfile"
|
40 |
zstd -l "$outfile"
|
41 |
echo
|
42 |
echo
|
43 |
echo "$file" 1>&3
|
44 |
+
done 3>&1 1>&2 | $PV -l -s "$filecount" -N "$clonepath"
|
meta-llama_Llama-3.2-1B_4e20de362430cd3b72f300e6b0f18e50e7166e08.logits.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cf91a8326bf10191c5159b95380774e690ea7086792cb4f1e8b735c9e30dbcd1
|
3 |
+
size 12049921944
|
run_test.py
CHANGED
@@ -28,15 +28,15 @@ if config.model_type == 'deepseek_v3':
|
|
28 |
model = Model.from_pretrained(model_id, revision=revision, trust_remote_code=True, torch_dtype=torch.float64, use_safetensors=True)
|
29 |
if config.model_type == 'deepseek_v3':
|
30 |
model._supports_cache_class = False
|
31 |
-
model = accelerate.cpu_offload(model, 'cuda:0', offload_buffers=True)
|
32 |
|
33 |
-
pipe = transformers.pipeline('text-generation', model=model, config=config, tokenizer=tokenizer)
|
34 |
|
35 |
tensors = {}
|
36 |
def store_tensor(descr, tensor):
|
37 |
-
tensors[descr] = tensor.cpu().detach().contiguous()
|
38 |
|
39 |
-
IDX = 0
|
40 |
module_names = {mod:name for name, mod in pipe.model.named_modules()}
|
41 |
tensors = {}
|
42 |
def hook(module, inputs, outputs):
|
|
|
28 |
model = Model.from_pretrained(model_id, revision=revision, trust_remote_code=True, torch_dtype=torch.float64, use_safetensors=True)
|
29 |
if config.model_type == 'deepseek_v3':
|
30 |
model._supports_cache_class = False
|
31 |
+
#model = accelerate.cpu_offload(model, 'cuda:0', offload_buffers=True)
|
32 |
|
33 |
+
pipe = transformers.pipeline('text-generation', model=model, config=config, tokenizer=tokenizer, device='cpu')
|
34 |
|
35 |
tensors = {}
|
36 |
def store_tensor(descr, tensor):
|
37 |
+
tensors[descr] = tensor.cpu().detach().contiguous().clone()
|
38 |
|
39 |
+
IDX = 0 # IDX is unused
|
40 |
module_names = {mod:name for name, mod in pipe.model.named_modules()}
|
41 |
tensors = {}
|
42 |
def hook(module, inputs, outputs):
|