JackAILab commited on
Commit
7299158
·
verified ·
1 Parent(s): 1b07036

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -46,14 +46,18 @@ def load_model(queue, bise_net_cp_path):
46
  queue.put(bise_net)
47
  ## BiSenet
48
  bise_net_cp_path = hf_hub_download(repo_id="JackAILab/ConsistentID", filename="face_parsing.pth", repo_type="model")
49
- # Create a queue to share data between processes
50
- queue = Queue()
51
- # Create a new process and start it
52
- p = Process(target=load_model, args=(queue, bise_net_cp_path))
53
- p.start()
54
- # Wait for the process to finish and get the result
55
- p.join()
56
- bise_net = queue.get()
 
 
 
 
57
 
58
  ### Load consistentID_model checkpoint
59
  pipe.load_ConsistentID_model(
 
46
  queue.put(bise_net)
47
  ## BiSenet
48
  bise_net_cp_path = hf_hub_download(repo_id="JackAILab/ConsistentID", filename="face_parsing.pth", repo_type="model")
49
+ ## Create a manager object
50
+ with Manager() as manager:
51
+ # Create a queue to share data between processes
52
+ queue = manager.Queue()
53
+
54
+ # Create a new process and start it
55
+ p = Process(target=load_model, args=(queue, bise_net_cp_path))
56
+ p.start()
57
+
58
+ # Wait for the process to finish and get the result
59
+ p.join()
60
+ bise_net = queue.get()
61
 
62
  ### Load consistentID_model checkpoint
63
  pipe.load_ConsistentID_model(