Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 |
-
|
50 |
-
|
51 |
-
# Create a
|
52 |
-
|
53 |
-
|
54 |
-
#
|
55 |
-
p
|
56 |
-
|
|
|
|
|
|
|
|
|
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(
|