Przeglądaj źródła

Move the chat example dialogue to the prompt

oobabooga 2 lat temu
rodzic
commit
e861e68e38
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      modules/chat.py

+ 2 - 2
modules/chat.py

@@ -220,7 +220,7 @@ def clear_chat_log(name1, name2):
         for i in range(len(shared.history['internal'])):
             if '<|BEGIN-VISIBLE-CHAT|>' in shared.history['internal'][i][0]:
                 shared.history['visible'] = [['', apply_extensions(shared.history['internal'][i][1], "output")]]
-                shared.history['internal'] = shared.history['internal'][:i+1]
+                shared.history['internal'] = [shared.history['internal'][i]]
                 found = True
                 break
         if not found:
@@ -331,7 +331,7 @@ def load_character(_character, name1, name2):
             context += f"Scenario: {data['world_scenario']}\n"
         context = f"{context.strip()}\n<START>\n"
         if 'example_dialogue' in data and data['example_dialogue'] != '':
-            shared.history['internal'] = tokenize_dialogue(data['example_dialogue'], name1, name2)
+            context += f"{data['example_dialogue'].strip()}\n"
         if 'char_greeting' in data and len(data['char_greeting'].strip()) > 0:
             shared.history['internal'] += [['<|BEGIN-VISIBLE-CHAT|>', data['char_greeting']]]
             shared.history['visible'] += [['', apply_extensions(data['char_greeting'], "output")]]