You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llama_cpp/server/app.py
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -191,6 +191,27 @@ def get_settings():
191
191
description="Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.",
192
192
)
193
193
194
+
mirostat_mode_field=Field(
195
+
default=0,
196
+
ge=0,
197
+
le=2,
198
+
description="Enable Mirostat constant-perplexity algorithm of the specified version (1 or 2; 0 = disabled)"
199
+
)
200
+
201
+
mirostat_tau_field=Field(
202
+
default=5.0,
203
+
ge=0.0,
204
+
le=10.0,
205
+
description="Mirostat target entropy, i.e. the target perplexity - lower values produce focused and coherent text, larger values produce more diverse and less coherent text"
206
+
)
207
+
208
+
mirostat_eta_field=Field(
209
+
default=0.1,
210
+
ge=0.001,
211
+
le=1.0,
212
+
description="Mirostat learning rate"
213
+
)
214
+
194
215
195
216
classCreateCompletionRequest(BaseModel):
196
217
prompt: Union[str, List[str]] =Field(
@@ -203,6 +224,9 @@ class CreateCompletionRequest(BaseModel):
203
224
max_tokens: int=max_tokens_field
204
225
temperature: float=temperature_field
205
226
top_p: float=top_p_field
227
+
mirostat_mode: int=mirostat_mode_field
228
+
mirostat_tau: float=mirostat_tau_field
229
+
mirostat_eta: float=mirostat_eta_field
206
230
echo: bool=Field(
207
231
default=False,
208
232
description="Whether to echo the prompt in the generated text. Useful for chatbots.",
@@ -332,6 +356,9 @@ class CreateChatCompletionRequest(BaseModel):
0 commit comments