(infer_backend, test_vlm: bool = False)
| 64 | |
| 65 | |
| 66 | def _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 | |
| 82 | def test_vllm_vlm(): |
no test coverage detected