Skip to content

Commit

Permalink
update vllm params (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZYC-ModelCloud authored Oct 23, 2024
1 parent cdec2a7 commit af8b371
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gptqmodel/utils/vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ def convert_hf_params_to_vllm(hf_params: Dict[str, Any]):
'top_p': hf_params.get('top_p', 1.0),
'max_tokens': hf_params.get('max_length', 16),
'min_tokens': hf_params.get('min_length', 0),
'early_stopping': hf_params.get('early_stopping', False),
'length_penalty': hf_params.get('length_penalty', 1.0),
'stop_token_ids': [hf_params.get('eos_token_id'), None],
}
return SamplingParams(**params)
Expand Down Expand Up @@ -58,8 +56,7 @@ def vllm_generate(
if not isinstance(sampling_params, SamplingParams):
hf_params = {key: kwargs[key] for key in [
'num_return_sequences', 'repetition_penalty', 'temperature',
'top_k', 'top_p', 'max_length', 'min_length',
'early_stopping', 'length_penalty', 'eos_token_id'
'top_k', 'top_p', 'max_length', 'min_length', 'eos_token_id'
] if key in kwargs}
sampling_params = convert_hf_params_to_vllm(hf_params)

Expand Down

0 comments on commit af8b371

Please sign in to comment.