mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-03-30 06:57:09 +08:00
Remove from_dict from SpeculativeConfig (#22451)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
parent
139d155781
commit
7e3a8dc906
@ -47,13 +47,12 @@ def test_ngram_proposer():
|
||||
model_config = ModelConfig(model="facebook/opt-125m")
|
||||
return NgramProposer(
|
||||
vllm_config=VllmConfig(model_config=model_config,
|
||||
speculative_config=SpeculativeConfig.
|
||||
from_dict({
|
||||
"prompt_lookup_min": min_n,
|
||||
"prompt_lookup_max": max_n,
|
||||
"num_speculative_tokens": k,
|
||||
"method": "ngram",
|
||||
})))
|
||||
speculative_config=SpeculativeConfig(
|
||||
prompt_lookup_min=min_n,
|
||||
prompt_lookup_max=max_n,
|
||||
num_speculative_tokens=k,
|
||||
method="ngram",
|
||||
)))
|
||||
|
||||
# No match.
|
||||
result = ngram_proposer(
|
||||
|
||||
@ -2895,11 +2895,6 @@ class SpeculativeConfig:
|
||||
usedforsecurity=False).hexdigest()
|
||||
return hash_str
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dict_value: dict) -> "SpeculativeConfig":
|
||||
"""Parse the CLI value for the speculative config."""
|
||||
return cls(**dict_value)
|
||||
|
||||
@staticmethod
|
||||
def hf_config_override(hf_config: PretrainedConfig) -> PretrainedConfig:
|
||||
if hf_config.model_type == "deepseek_v3":
|
||||
|
||||
@ -757,18 +757,6 @@ class EngineArgs:
|
||||
lora_group.add_argument("--default-mm-loras",
|
||||
**lora_kwargs["default_mm_loras"])
|
||||
|
||||
# Speculative arguments
|
||||
speculative_group = parser.add_argument_group(
|
||||
title="SpeculativeConfig",
|
||||
description=SpeculativeConfig.__doc__,
|
||||
)
|
||||
speculative_group.add_argument(
|
||||
"--speculative-config",
|
||||
type=json.loads,
|
||||
default=None,
|
||||
help="The configurations for speculative decoding. Should be a "
|
||||
"JSON string.")
|
||||
|
||||
# Observability arguments
|
||||
observability_kwargs = get_kwargs(ObservabilityConfig)
|
||||
observability_group = parser.add_argument_group(
|
||||
@ -848,6 +836,8 @@ class EngineArgs:
|
||||
title="VllmConfig",
|
||||
description=VllmConfig.__doc__,
|
||||
)
|
||||
vllm_group.add_argument("--speculative-config",
|
||||
**vllm_kwargs["speculative_config"])
|
||||
vllm_group.add_argument("--kv-transfer-config",
|
||||
**vllm_kwargs["kv_transfer_config"])
|
||||
vllm_group.add_argument('--kv-events-config',
|
||||
@ -1033,10 +1023,7 @@ class EngineArgs:
|
||||
"enable_chunked_prefill": enable_chunked_prefill,
|
||||
"disable_log_stats": disable_log_stats,
|
||||
})
|
||||
speculative_config = SpeculativeConfig.from_dict(
|
||||
self.speculative_config)
|
||||
|
||||
return speculative_config
|
||||
return SpeculativeConfig(**self.speculative_config)
|
||||
|
||||
def create_engine_config(
|
||||
self,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user