Update index.html
Browse files- index.html +6 -0
index.html
CHANGED
@@ -72,9 +72,15 @@
|
|
72 |
let model_size = 0
|
73 |
try {
|
74 |
model_size = (await fetch(`https://huggingface.co/${hf_model}/raw/main/model.safetensors.index.json`).then(r => r.json()))["metadata"]["total_size"] / 2
|
|
|
|
|
|
|
75 |
} catch (e) {
|
76 |
try {
|
77 |
model_size = (await fetch(`https://huggingface.co/${hf_model}/raw/main/pytorch_model.bin.index.json`).then(r => r.json()))["metadata"]["total_size"] / 2
|
|
|
|
|
|
|
78 |
} catch {
|
79 |
let model_page = await fetch(
|
80 |
"https://corsproxy.io/?" + encodeURIComponent(`https://huggingface.co/${hf_model}`)
|
|
|
72 |
let model_size = 0
|
73 |
try {
|
74 |
model_size = (await fetch(`https://huggingface.co/${hf_model}/raw/main/model.safetensors.index.json`).then(r => r.json()))["metadata"]["total_size"] / 2
|
75 |
+
if (model_size === undefined) {
|
76 |
+
throw new Erorr("no size in safetensors metadata")
|
77 |
+
}
|
78 |
} catch (e) {
|
79 |
try {
|
80 |
model_size = (await fetch(`https://huggingface.co/${hf_model}/raw/main/pytorch_model.bin.index.json`).then(r => r.json()))["metadata"]["total_size"] / 2
|
81 |
+
if (model_size === undefined) {
|
82 |
+
throw new Erorr("no size in pytorch metadata")
|
83 |
+
}
|
84 |
} catch {
|
85 |
let model_page = await fetch(
|
86 |
"https://corsproxy.io/?" + encodeURIComponent(`https://huggingface.co/${hf_model}`)
|