13
13
# limitations under the License.
14
14
15
15
import asyncio
16
+ import multiprocessing
17
+ from typing import Dict , Optional
18
+
16
19
import pytest
17
20
import xoscar as xo
18
- from typing import List , Optional , Union , Dict
19
- import multiprocessing
20
21
21
22
from ...core .supervisor import SupervisorActor
22
23
23
24
24
-
25
25
# test restart supervisor
26
26
@pytest .mark .asyncio
27
27
async def test_restart_supervisor ():
28
28
from ...deploy .supervisor import run_in_subprocess as supervisor_run_in_subprocess
29
29
from ...deploy .worker import main as _start_worker
30
30
31
31
def worker_run_in_subprocess (
32
- address : str ,
33
- supervisor_address : str ,
34
- logging_conf : Optional [Dict ] = None
32
+ address : str , supervisor_address : str , logging_conf : Optional [Dict ] = None
35
33
) -> multiprocessing .Process :
36
- p = multiprocessing .Process (target = _start_worker , args = (address , supervisor_address , None , None , logging_conf ))
34
+ p = multiprocessing .Process (
35
+ target = _start_worker ,
36
+ args = (address , supervisor_address , None , None , logging_conf ),
37
+ )
37
38
p .start ()
38
39
return p
39
40
@@ -45,10 +46,10 @@ def worker_run_in_subprocess(
45
46
46
47
# start worker
47
48
worker_run_in_subprocess (
48
- address = f"localhost:{ xo .utils .get_next_port ()} " ,
49
- supervisor_address = supervisor_address
49
+ address = f"localhost:{ xo .utils .get_next_port ()} " ,
50
+ supervisor_address = supervisor_address ,
50
51
)
51
-
52
+
52
53
await asyncio .sleep (10 )
53
54
54
55
# load model
@@ -62,7 +63,7 @@ def worker_run_in_subprocess(
62
63
model_name = "qwen1.5-chat" ,
63
64
model_size_in_billions = "0_5" ,
64
65
quantization = "q4_0" ,
65
- model_engine = "vLLM"
66
+ model_engine = "llama.cpp" ,
66
67
)
67
68
68
69
# query replica info
0 commit comments