Spaces:
Runtime error
Runtime error
Commit
Β·
8776288
1
Parent(s):
14c84e8
Added debug prints for failure or success loading concepts
Browse files
app.py
CHANGED
@@ -126,22 +126,15 @@ def load_learned_embed_in_clip(learned_embeds_path, text_encoder, tokenizer, tok
|
|
126 |
|
127 |
ahx_model_list = [model for model in models_list if "ahx" in model.modelId]
|
128 |
|
|
|
|
|
|
|
129 |
from time import sleep
|
|
|
130 |
print("--------------------------------------------------")
|
131 |
print("--------------------------------------------------")
|
|
|
132 |
print("--------------------------------------------------")
|
133 |
-
print("models_list:")
|
134 |
-
print(models_list)
|
135 |
-
print("--------------------------------------------------")
|
136 |
-
print("ahx_model_list:")
|
137 |
-
print(ahx_model_list)
|
138 |
-
print("--------------------------------------------------")
|
139 |
-
print("--------------------------------------------------")
|
140 |
-
print("--------------------------------------------------")
|
141 |
-
sleep(60)
|
142 |
-
|
143 |
-
|
144 |
-
print("Setting up the public library")
|
145 |
for model in ahx_model_list:
|
146 |
model_content = {}
|
147 |
model_id = model.modelId
|
@@ -152,7 +145,17 @@ for model in ahx_model_list:
|
|
152 |
try:
|
153 |
wget.download(embeds_url, out=model_id)
|
154 |
except:
|
|
|
|
|
|
|
|
|
|
|
155 |
continue
|
|
|
|
|
|
|
|
|
|
|
156 |
token_identifier = f"https://huggingface.co/{model_id}/raw/main/token_identifier.txt"
|
157 |
response = requests.get(token_identifier)
|
158 |
token_name = response.text
|
@@ -179,6 +182,12 @@ for model in ahx_model_list:
|
|
179 |
continue
|
180 |
model_content["token"] = learned_token
|
181 |
models.append(model_content)
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
|
183 |
#@title Run the app to navigate around [the Library](https://huggingface.co/sd-concepts-library)
|
184 |
#@markdown Click the `Running on public URL:` result to run the Gradio app
|
|
|
126 |
|
127 |
ahx_model_list = [model for model in models_list if "ahx" in model.modelId]
|
128 |
|
129 |
+
|
130 |
+
|
131 |
+
# UNDER CONSTRUCTION ---------------------------------------------------------------
|
132 |
from time import sleep
|
133 |
+
|
134 |
print("--------------------------------------------------")
|
135 |
print("--------------------------------------------------")
|
136 |
+
print("Setting up the public library........")
|
137 |
print("--------------------------------------------------")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
for model in ahx_model_list:
|
139 |
model_content = {}
|
140 |
model_id = model.modelId
|
|
|
145 |
try:
|
146 |
wget.download(embeds_url, out=model_id)
|
147 |
except:
|
148 |
+
print("FAILURE: <-------------------------------------------------------------------")
|
149 |
+
print("model -->", model)
|
150 |
+
print("model_id -->", model_id)
|
151 |
+
print("CONTINUING - MODEL NOT LOADING")
|
152 |
+
sleep(30)
|
153 |
continue
|
154 |
+
|
155 |
+
print("success / model loaded:")
|
156 |
+
print("model -->", model)
|
157 |
+
print("model_id -->", model_id)
|
158 |
+
|
159 |
token_identifier = f"https://huggingface.co/{model_id}/raw/main/token_identifier.txt"
|
160 |
response = requests.get(token_identifier)
|
161 |
token_name = response.text
|
|
|
182 |
continue
|
183 |
model_content["token"] = learned_token
|
184 |
models.append(model_content)
|
185 |
+
models.append(model_content)
|
186 |
+
print("--------------------------------------------------")
|
187 |
+
|
188 |
+
print("--------------------------------------------------")
|
189 |
+
print("--------------------------------------------------")
|
190 |
+
print("--------------------------------------------------")
|
191 |
|
192 |
#@title Run the app to navigate around [the Library](https://huggingface.co/sd-concepts-library)
|
193 |
#@markdown Click the `Running on public URL:` result to run the Gradio app
|