NyxKrage commited on
Commit
f6519fe
1 Parent(s): 0b4ceff

Update index.html

Browse files
Files changed (1) hide show
  1. 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}`)