Update index.html
Browse files- index.html +3 -2
index.html
CHANGED
|
@@ -93,14 +93,15 @@
|
|
| 93 |
}
|
| 94 |
let config = await configRes.json()
|
| 95 |
let model_size = 0
|
|
|
|
| 96 |
try {
|
| 97 |
-
model_size = (await fetch(`https://huggingface.co/${hf_model}/resolve/main/model.safetensors.index.json`, auth).then(r => r.json()))["metadata"]["total_size"] /
|
| 98 |
if (isNaN(model_size)) {
|
| 99 |
throw new Error("no size in safetensors metadata")
|
| 100 |
}
|
| 101 |
} catch (e) {
|
| 102 |
try {
|
| 103 |
-
model_size = (await fetch(`https://huggingface.co/${hf_model}/resolve/main/pytorch_model.bin.index.json`, auth).then(r => r.json()))["metadata"]["total_size"] /
|
| 104 |
if (isNaN(model_size)) {
|
| 105 |
throw new Error("no size in pytorch metadata")
|
| 106 |
}
|
|
|
|
| 93 |
}
|
| 94 |
let config = await configRes.json()
|
| 95 |
let model_size = 0
|
| 96 |
+
let dtype = parseInt(config["torch_dtype"].replaceAll(/\D/g, '')) / 8
|
| 97 |
try {
|
| 98 |
+
model_size = (await fetch(`https://huggingface.co/${hf_model}/resolve/main/model.safetensors.index.json`, auth).then(r => r.json()))["metadata"]["total_size"] / dtype
|
| 99 |
if (isNaN(model_size)) {
|
| 100 |
throw new Error("no size in safetensors metadata")
|
| 101 |
}
|
| 102 |
} catch (e) {
|
| 103 |
try {
|
| 104 |
+
model_size = (await fetch(`https://huggingface.co/${hf_model}/resolve/main/pytorch_model.bin.index.json`, auth).then(r => r.json()))["metadata"]["total_size"] / dtype
|
| 105 |
if (isNaN(model_size)) {
|
| 106 |
throw new Error("no size in pytorch metadata")
|
| 107 |
}
|