[vicuna] Fix vicuna chatbot (#1499)

Signed-off-by: Gaurav Shukla <gaurav@nod-labs.com>
This commit is contained in:
Gaurav Shukla
2023-06-06 21:53:32 +05:30
committed by GitHub
parent f23b778a6c
commit be62fce676

View File

@@ -56,9 +56,16 @@ def chat(curr_system_message, history, model):
)
prompt = messages.strip()
print("prompt = ", prompt)
new_sentence = vicuna_model.generate(prompt)
history[-1][1] = new_sentence
print(new_sentence)
sentence = vicuna_model.generate(prompt)
partial_text = ""
for new_text in sentence.split(" "):
# print(new_text)
partial_text += new_text + " "
history[-1][1] = partial_text
# Yield an empty string to cleanup the message textbox and the updated conversation history
yield history
history[-1][1] = sentence
return history
# else Model is StableLM