Explorar o código

Prevent streaming with no_stream + generation attempts > 1

oobabooga %!s(int64=2) %!d(string=hai) anos
pai
achega
9456c1d6ed
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      modules/chat.py

+ 1 - 1
modules/chat.py

@@ -135,7 +135,7 @@ def chatbot_wrapper(text, max_new_tokens, do_sample, temperature, top_p, typical
 
 
             shared.history['internal'][-1] = [text, reply]
             shared.history['internal'][-1] = [text, reply]
             shared.history['visible'][-1] = [visible_text, visible_reply]
             shared.history['visible'][-1] = [visible_text, visible_reply]
-            if not substring_found:
+            if not substring_found and not shared.args.no_stream:
                 yield shared.history['visible']
                 yield shared.history['visible']
             if next_character_found:
             if next_character_found:
                 break
                 break