瀏覽代碼

Fix llama.cpp with --no-stream

oobabooga 2 年之前
父節點
當前提交
2259143fec
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      modules/llamacpp_model.py

+ 1 - 3
modules/llamacpp_model.py

@@ -1,8 +1,5 @@
-from pathlib import Path
-
 import llamacpp
 
-import modules.shared as shared
 from modules.callbacks import Iteratorize
 
 
@@ -65,6 +62,7 @@ class LlamaCppModel:
                 self.model.eval()
                 token = self.model.sample()
                 text = self.model.token_to_str(token)
+                output += text
                 is_end_of_text = token == self.model.token_eos()
                 if callback:
                     callback(text)