8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4a1bbe commit 353e18aCopy full SHA for 353e18a
llama_cpp/llama.py
@@ -169,6 +169,11 @@ def sample(
169
The sampled token.
170
"""
171
assert self.ctx is not None
172
+ # Temporary workaround for https://github.com/ggerganov/llama.cpp/issues/684
173
+ if temp == 0.0:
174
+ temp = 1.0
175
+ top_p = 0.0
176
+ top_k = 1
177
return llama_cpp.llama_sample_top_p_top_k(
178
ctx=self.ctx,
179
last_n_tokens_data=(llama_cpp.llama_token * self.last_n_tokens_size)(
@@ -209,11 +214,6 @@ def generate(
209
214
Yields:
210
215
The generated tokens.
211
216
212
- # Temporary workaround for https://github.com/ggerganov/llama.cpp/issues/684
213
- if temp == 0.0:
- temp = 1.0
- top_p = 0.0
- top_k = 1
217
218
self.reset()
219
while True:
0 commit comments