File tree 3 files changed +10
-0
lines changed
_internal/serve/deployments/llm/vllm
cpu/deployments/llm/multiplex
3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -215,11 +215,16 @@ class VLLMSamplingParams(SamplingParams):
215
215
Args:
216
216
top_k: The number of highest probability vocabulary tokens to keep for top-k-filtering.
217
217
seed: Seed for deterministic sampling with temperature>0.
218
+ repetition_penalty: Float that penalizes new tokens based on whether they
219
+ appear in the prompt and the generated text so far. Values > 1 encourage
220
+ the model to use new tokens, while values < 1 encourage the model to repeat
221
+ tokens.
218
222
"""
219
223
220
224
_ignored_fields = {"best_of" , "n" , "logit_bias" }
221
225
222
226
top_k : Optional [int ] = None
227
+ repetition_penalty : Optional [float ] = None
223
228
seed : Optional [int ] = None
224
229
kv_transfer_params : Optional [Dict [str , Any ]] = None
225
230
Original file line number Diff line number Diff line change 74
74
"ignore_eos" : None ,
75
75
"presence_penalty" : None ,
76
76
"frequency_penalty" : None ,
77
+ "repetition_penalty" : None ,
77
78
"best_of" : 1 ,
78
79
"response_format" : None ,
79
80
"top_k" : None ,
@@ -179,6 +180,7 @@ async def test_multiplex_deployment(
179
180
"ignore_eos" : None ,
180
181
"presence_penalty" : None ,
181
182
"frequency_penalty" : None ,
183
+ "repetition_penalty" : None ,
182
184
"top_k" : None ,
183
185
"response_format" : None ,
184
186
"logprobs" : None ,
Original file line number Diff line number Diff line change @@ -166,6 +166,9 @@ def _parse_sampling_params(
166
166
frequency_penalty = sampling_params .frequency_penalty
167
167
if sampling_params .frequency_penalty is not None
168
168
else 0.0 ,
169
+ repetition_penalty = sampling_params .repetition_penalty
170
+ if sampling_params .repetition_penalty is not None
171
+ else 1.0 ,
169
172
temperature = sampling_params .temperature
170
173
if sampling_params .temperature is not None
171
174
else 1.0 ,
You can’t perform that action at this time.
0 commit comments