mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-26 09:40:20 +01:00
Fix llama.cpp with --no-stream
This commit is contained in:
parent
875de5d983
commit
2259143fec
@ -1,8 +1,5 @@
|
|||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import llamacpp
|
import llamacpp
|
||||||
|
|
||||||
import modules.shared as shared
|
|
||||||
from modules.callbacks import Iteratorize
|
from modules.callbacks import Iteratorize
|
||||||
|
|
||||||
|
|
||||||
@ -65,6 +62,7 @@ class LlamaCppModel:
|
|||||||
self.model.eval()
|
self.model.eval()
|
||||||
token = self.model.sample()
|
token = self.model.sample()
|
||||||
text = self.model.token_to_str(token)
|
text = self.model.token_to_str(token)
|
||||||
|
output += text
|
||||||
is_end_of_text = token == self.model.token_eos()
|
is_end_of_text = token == self.model.token_eos()
|
||||||
if callback:
|
if callback:
|
||||||
callback(text)
|
callback(text)
|
||||||
|
Loading…
Reference in New Issue
Block a user