File tree Expand file tree Collapse file tree 1 file changed +18
-11
lines changed
tests/models/language/generation Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change 7
7
8
8
9
9
@pytest .mark .parametrize ("model" , MODELS )
10
- def test_dummy_loader (vllm_runner , model : str ) -> None :
11
- with vllm_runner (
12
- model ,
13
- load_format = "dummy" ,
14
- ) as llm :
15
- normalizers = llm .collective_rpc (lambda self : self .worker .model_runner .
16
- model .model .normalizer .cpu ().item ())
17
- assert np .allclose (
18
- normalizers ,
19
- llm .llm_engine .model_config .hf_config .hidden_size ** 0.5 ,
20
- rtol = 1e-3 )
10
+ def test_dummy_loader (vllm_runner , monkeypatch , model : str ) -> None :
11
+ with monkeypatch .context () as m :
12
+ m .setenv ("VLLM_ALLOW_INSECURE_SERIALIZATION" , "1" )
13
+ with vllm_runner (
14
+ model ,
15
+ load_format = "dummy" ,
16
+ ) as llm :
17
+ if model == "google/gemma-3-4b-it" :
18
+ normalizers = llm .model .collective_rpc (
19
+ lambda self : self .model_runner .model .language_model .model .
20
+ normalizer .cpu ().item ())
21
+ config = llm .model .llm_engine .model_config .hf_config .text_config
22
+ else :
23
+ normalizers = llm .model .collective_rpc (
24
+ lambda self : self .model_runner .model .model .normalizer .cpu (
25
+ ).item ())
26
+ config = llm .model .llm_engine .model_config .hf_config
27
+ assert np .allclose (normalizers , config .hidden_size ** 0.5 , rtol = 2e-3 )
You can’t perform that action at this time.
0 commit comments