cbensimon HF staff commited on
Commit
7ce0ef0
1 Parent(s): f0bf100

GPU task aborted fix attempt

Browse files

Getting those kind of errors in app logs :
```
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 14: Can't spawn new thread: res = 11
```

Fix from https://blog.csdn.net/zsytony/article/details/116712444

Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -50,6 +50,8 @@ ip_model_plus = IPAdapterFaceIDPlus(pipe, image_encoder_path, ip_plus_ckpt, devi
50
  app = FaceAnalysis(name="buffalo_l", providers=['CPUExecutionProvider'])
51
  app.prepare(ctx_id=0, det_size=(640, 640))
52
 
 
 
53
  @spaces.GPU(enable_queue=True)
54
  def generate_image(images, prompt, negative_prompt, preserve_face_structure, face_strength, likeness_strength, nfaa_negative_prompt, progress=gr.Progress(track_tqdm=True)):
55
  faceid_all_embeds = []
 
50
  app = FaceAnalysis(name="buffalo_l", providers=['CPUExecutionProvider'])
51
  app.prepare(ctx_id=0, det_size=(640, 640))
52
 
53
+ cv2.setNumThreads(1)
54
+
55
  @spaces.GPU(enable_queue=True)
56
  def generate_image(images, prompt, negative_prompt, preserve_face_structure, face_strength, likeness_strength, nfaa_negative_prompt, progress=gr.Progress(track_tqdm=True)):
57
  faceid_all_embeds = []