update model_worker.py
Browse files- model_worker.py +3 -0
model_worker.py
CHANGED
@@ -20,6 +20,7 @@ import uuid
|
|
20 |
import traceback
|
21 |
from functools import partial
|
22 |
from threading import Thread
|
|
|
23 |
|
24 |
import requests
|
25 |
import torch
|
@@ -38,6 +39,8 @@ from utils import (
|
|
38 |
load_image_from_base64,
|
39 |
)
|
40 |
|
|
|
|
|
41 |
worker_id = str(uuid.uuid4())[:6]
|
42 |
logger = build_logger("model_worker", f"model_worker_{worker_id}.log")
|
43 |
global_counter = 0
|
|
|
20 |
import traceback
|
21 |
from functools import partial
|
22 |
from threading import Thread
|
23 |
+
import multiprocessing as mp
|
24 |
|
25 |
import requests
|
26 |
import torch
|
|
|
39 |
load_image_from_base64,
|
40 |
)
|
41 |
|
42 |
+
mp.set_start_method("spawn", force=True)
|
43 |
+
|
44 |
worker_id = str(uuid.uuid4())[:6]
|
45 |
logger = build_logger("model_worker", f"model_worker_{worker_id}.log")
|
46 |
global_counter = 0
|