Sfoglia il codice sorgente

Improve pygmalion line breaks

oobabooga 3 anni fa
parent
commit
9a7f187b5a
2 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      server.py
  2. BIN
      webui.png

+ 2 - 1
server.py

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

BIN
webui.png