1313# limitations under the License.
1414
1515import asyncio
16+ import multiprocessing
17+ from typing import Dict , Optional
18+
1619import pytest
1720import xoscar as xo
18- from typing import List , Optional , Union , Dict
19- import multiprocessing
2021
2122from ...core .supervisor import SupervisorActor
2223
2324
24-
2525# test restart supervisor
2626@pytest .mark .asyncio
2727async def test_restart_supervisor ():
2828 from ...deploy .supervisor import run_in_subprocess as supervisor_run_in_subprocess
2929 from ...deploy .worker import main as _start_worker
3030
3131 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
3533 ) -> 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+ )
3738 p .start ()
3839 return p
3940
@@ -45,10 +46,10 @@ def worker_run_in_subprocess(
4546
4647 # start worker
4748 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 ,
5051 )
51-
52+
5253 await asyncio .sleep (10 )
5354
5455 # load model
@@ -62,7 +63,7 @@ def worker_run_in_subprocess(
6263 model_name = "qwen1.5-chat" ,
6364 model_size_in_billions = "0_5" ,
6465 quantization = "q4_0" ,
65- model_engine = "vLLM"
66+ model_engine = "llama.cpp" ,
6667 )
6768
6869 # query replica info
0 commit comments