[CI/Test] improve robustness of test (hf_runner) (#5347)
[CI/Test] improve robustness of test by replacing del with context manager (hf_runner) (#5347)
This commit is contained in:
@@ -28,9 +28,8 @@ def test_models(
|
||||
model: str,
|
||||
dtype: str,
|
||||
) -> None:
|
||||
hf_model = hf_runner(model, dtype=dtype, is_embedding_model=True)
|
||||
hf_outputs = hf_model.encode(example_prompts)
|
||||
del hf_model
|
||||
with hf_runner(model, dtype=dtype, is_embedding_model=True) as hf_model:
|
||||
hf_outputs = hf_model.encode(example_prompts)
|
||||
|
||||
vllm_model = vllm_runner(model, dtype=dtype)
|
||||
vllm_outputs = vllm_model.encode(example_prompts)
|
||||
|
||||
Reference in New Issue
Block a user