mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-29 21:50:16 +01:00
Improve the Metharme prompt
This commit is contained in:
parent
e5b1547849
commit
b7a589afc8
@ -1,4 +1,4 @@
|
|||||||
user: "<|user|>"
|
user: "<|user|>"
|
||||||
bot: "<|model|>"
|
bot: "<|model|>"
|
||||||
context: "<|system|>"
|
context: "<|system|>This is a text adventure game. Describe the scenario to the user and give him three options to pick from on each turn."
|
||||||
turn_template: "<|user|><|user-message|><|bot|><|bot-message|>"
|
turn_template: "<|user|><|user-message|><|bot|><|bot-message|>"
|
||||||
|
@ -188,7 +188,7 @@ def chatbot_wrapper(text, state, regenerate=False, _continue=False):
|
|||||||
# Generate
|
# Generate
|
||||||
for i in range(state['chat_generation_attempts']):
|
for i in range(state['chat_generation_attempts']):
|
||||||
reply = None
|
reply = None
|
||||||
for reply in generate_reply(f"{prompt}{' ' if len(cumulative_reply) > 0 else ''}{cumulative_reply}", state, eos_token=eos_token, stopping_strings=stopping_strings):
|
for j, reply in enumerate(generate_reply(f"{prompt}{' ' if len(cumulative_reply) > 0 else ''}{cumulative_reply}", state, eos_token=eos_token, stopping_strings=stopping_strings)):
|
||||||
reply = cumulative_reply + reply
|
reply = cumulative_reply + reply
|
||||||
|
|
||||||
# Extracting the reply
|
# Extracting the reply
|
||||||
@ -212,9 +212,11 @@ def chatbot_wrapper(text, state, regenerate=False, _continue=False):
|
|||||||
shared.history['internal'].append(['', ''])
|
shared.history['internal'].append(['', ''])
|
||||||
shared.history['visible'].append(['', ''])
|
shared.history['visible'].append(['', ''])
|
||||||
|
|
||||||
shared.history['internal'][-1] = [text, reply]
|
if not (j == 0 and visible_reply.strip() == ''):
|
||||||
shared.history['visible'][-1] = [visible_text, visible_reply]
|
shared.history['internal'][-1] = [text, reply]
|
||||||
yield shared.history['visible']
|
shared.history['visible'][-1] = [visible_text, visible_reply]
|
||||||
|
yield shared.history['visible']
|
||||||
|
|
||||||
if next_character_found:
|
if next_character_found:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user