瀏覽代碼

Improve pygmalion line breaks

oobabooga 3 年之前
父節點
當前提交
9a7f187b5a
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      server.py
  2. 二進制
      webui.png

+ 2 - 1
server.py

@@ -201,10 +201,11 @@ elif args.chat:
             reply = reply[len(question):].split('\n')[0].strip()
         else:
             reply = generate_reply(question, tokens, inference_settings, selected_model)[0]
-            reply = reply[len(question):].strip()
+            reply = reply[len(question):]
             idx = reply.find(f"\n{name1}:")
             if idx != -1:
                 reply = reply[:idx]
+            reply = reply.replace('\n', '\n\n').strip()
 
         history.append((text, reply))
         return history

二進制
webui.png