mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-11 01:55:21 +08:00
[CI/Build] Fix v1 OOT registration test (#25547)
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
This commit is contained in:
parent
1cbcfb94de
commit
27ec3c78f3
@ -1079,7 +1079,7 @@ def dummy_llava_path():
|
|||||||
local_dir=_dummy_llava_path,
|
local_dir=_dummy_llava_path,
|
||||||
ignore_patterns=[
|
ignore_patterns=[
|
||||||
"*.bin", "*.bin.index.json", "*.pt", "*.h5",
|
"*.bin", "*.bin.index.json", "*.pt", "*.h5",
|
||||||
"*.msgpack"
|
"*.msgpack", "*.safetensors"
|
||||||
])
|
])
|
||||||
assert os.path.exists(json_path)
|
assert os.path.exists(json_path)
|
||||||
with open(json_path) as f:
|
with open(json_path) as f:
|
||||||
@ -1098,7 +1098,7 @@ def dummy_gemma2_embedding_path():
|
|||||||
local_dir=_dummy_gemma2_embedding_path,
|
local_dir=_dummy_gemma2_embedding_path,
|
||||||
ignore_patterns=[
|
ignore_patterns=[
|
||||||
"*.bin", "*.bin.index.json", "*.pt", "*.h5",
|
"*.bin", "*.bin.index.json", "*.pt", "*.h5",
|
||||||
"*.msgpack"
|
"*.msgpack", "*.safetensors"
|
||||||
])
|
])
|
||||||
assert os.path.exists(json_path)
|
assert os.path.exists(json_path)
|
||||||
with open(json_path) as f:
|
with open(json_path) as f:
|
||||||
|
|||||||
@ -42,7 +42,6 @@ def test_oot_registration_text_generation(
|
|||||||
assert rest == ""
|
assert rest == ""
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="This test is skipped because it failed on V1.")
|
|
||||||
@create_new_process_for_each_test()
|
@create_new_process_for_each_test()
|
||||||
def test_oot_registration_embedding(
|
def test_oot_registration_embedding(
|
||||||
monkeypatch: pytest.MonkeyPatch,
|
monkeypatch: pytest.MonkeyPatch,
|
||||||
@ -63,7 +62,6 @@ def test_oot_registration_embedding(
|
|||||||
image = convert_image_mode(ImageAsset("cherry_blossom").pil_image, "RGB")
|
image = convert_image_mode(ImageAsset("cherry_blossom").pil_image, "RGB")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="This test is skipped because it failed on V1.")
|
|
||||||
@create_new_process_for_each_test()
|
@create_new_process_for_each_test()
|
||||||
def test_oot_registration_multimodal(
|
def test_oot_registration_multimodal(
|
||||||
monkeypatch: pytest.MonkeyPatch,
|
monkeypatch: pytest.MonkeyPatch,
|
||||||
|
|||||||
@ -483,23 +483,23 @@ class _LazyRegisteredModel(_BaseRegisteredModel):
|
|||||||
def inspect_model_cls(self) -> _ModelInfo:
|
def inspect_model_cls(self) -> _ModelInfo:
|
||||||
model_path = Path(
|
model_path = Path(
|
||||||
__file__).parent / f"{self.module_name.split('.')[-1]}.py"
|
__file__).parent / f"{self.module_name.split('.')[-1]}.py"
|
||||||
|
module_hash = None
|
||||||
|
|
||||||
assert model_path.exists(), \
|
if model_path.exists():
|
||||||
f"Model {self.module_name} expected to be on path {model_path}"
|
with open(model_path, "rb") as f:
|
||||||
with open(model_path, "rb") as f:
|
module_hash = hashlib.md5(f.read()).hexdigest()
|
||||||
module_hash = hashlib.md5(f.read()).hexdigest()
|
|
||||||
|
|
||||||
mi = self._load_modelinfo_from_cache(module_hash)
|
mi = self._load_modelinfo_from_cache(module_hash)
|
||||||
if mi is not None:
|
if mi is not None:
|
||||||
logger.debug(("Loaded model info "
|
logger.debug(("Loaded model info "
|
||||||
"for class %s.%s from cache"), self.module_name,
|
"for class %s.%s from cache"), self.module_name,
|
||||||
self.class_name)
|
self.class_name)
|
||||||
return mi
|
return mi
|
||||||
else:
|
else:
|
||||||
logger.debug(("Cache model info "
|
logger.debug(("Cache model info "
|
||||||
"for class %s.%s miss. "
|
"for class %s.%s miss. "
|
||||||
"Loading model instead."), self.module_name,
|
"Loading model instead."), self.module_name,
|
||||||
self.class_name)
|
self.class_name)
|
||||||
|
|
||||||
# Performed in another process to avoid initializing CUDA
|
# Performed in another process to avoid initializing CUDA
|
||||||
mi = _run_in_subprocess(
|
mi = _run_in_subprocess(
|
||||||
@ -508,7 +508,8 @@ class _LazyRegisteredModel(_BaseRegisteredModel):
|
|||||||
self.class_name)
|
self.class_name)
|
||||||
|
|
||||||
# save cache file
|
# save cache file
|
||||||
self._save_modelinfo_to_cache(mi, module_hash)
|
if module_hash is not None:
|
||||||
|
self._save_modelinfo_to_cache(mi, module_hash)
|
||||||
|
|
||||||
return mi
|
return mi
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user