MCPcopy
hub / github.com/modelscope/ms-swift / _test

Function _test

tests/deploy/test_logprobs.py:66–79  ·  view source on GitHub ↗
(infer_backend, test_vlm: bool = False)

Source from the content-addressed store, hash-verified

64
65
66def _test(infer_backend, test_vlm: bool = False):
67 import os
68 os.environ['CUDA_VISIBLE_DEVICES'] = '0'
69
70 import multiprocessing
71
72 from swift import DeployArguments, deploy_main
73 mp = multiprocessing.get_context('spawn')
74 model = 'Qwen/Qwen2-VL-7B-Instruct' if test_vlm else 'Qwen/Qwen2-7B-Instruct'
75 args = DeployArguments(model=model, infer_backend=infer_backend, verbose=False)
76 process = mp.Process(target=deploy_main, args=(args, ))
77 process.start()
78 _test_client(args.port, True, test_vlm)
79 process.terminate()
80
81
82def test_vllm_vlm():

Callers 4

test_vllm_vlmFunction · 0.70
test_vllmFunction · 0.70
test_lmdeployFunction · 0.70
test_ptFunction · 0.70

Calls 3

DeployArgumentsClass · 0.90
startMethod · 0.80
_test_clientFunction · 0.70

Tested by

no test coverage detected