tombetthauser commited on
Commit
f341890
Β·
1 Parent(s): 8776288

Move debug prints to second try block in concept loading loop

Browse files
Files changed (1) hide show
  1. app.py +14 -9
app.py CHANGED
@@ -145,17 +145,12 @@ for model in ahx_model_list:
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
@@ -178,16 +173,26 @@ for model in ahx_model_list:
178
  #if token cannot be loaded, skip it
179
  try:
180
  learned_token = load_learned_embed_in_clip(f"{model_id}/learned_embeds.bin", pipe.text_encoder, pipe.tokenizer, token_name)
 
 
 
181
  except:
 
 
 
 
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
 
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
  continue
153
 
 
 
 
 
154
  token_identifier = f"https://huggingface.co/{model_id}/raw/main/token_identifier.txt"
155
  response = requests.get(token_identifier)
156
  token_name = response.text
 
173
  #if token cannot be loaded, skip it
174
  try:
175
  learned_token = load_learned_embed_in_clip(f"{model_id}/learned_embeds.bin", pipe.text_encoder, pipe.tokenizer, token_name)
176
+ print("success / model loaded:")
177
+ print("model -->", model)
178
+ print("model_id -->", model_id)
179
  except:
180
+ print("FAILURE: <- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -")
181
+ print("model -->", model)
182
+ print("model_id -->", model_id)
183
+ print("CONTINUING - MODEL NOT LOADING")
184
  continue
185
  model_content["token"] = learned_token
186
  models.append(model_content)
187
  models.append(model_content)
188
  print("--------------------------------------------------")
189
+ sleep(5)
190
+
191
 
192
  print("--------------------------------------------------")
193
  print("--------------------------------------------------")
194
  print("--------------------------------------------------")
195
+ sleep(60)
196
 
197
  #@title Run the app to navigate around [the Library](https://huggingface.co/sd-concepts-library)
198
  #@markdown Click the `Running on public URL:` result to run the Gradio app