Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def chatbot(message, history):
|
|
18 |
chat_prompt_template = ChatPromptTemplate.from_messages([prompt_template])
|
19 |
# Use the Langchain TextIteratorStreamer to generate responses
|
20 |
streamer = TextStreamer(model, tokenizer, chat_prompt_template)
|
21 |
-
response = model.generate(
|
22 |
return response
|
23 |
|
24 |
# Create a Gradio chatbot interface
|
|
|
18 |
chat_prompt_template = ChatPromptTemplate.from_messages([prompt_template])
|
19 |
# Use the Langchain TextIteratorStreamer to generate responses
|
20 |
streamer = TextStreamer(model, tokenizer, chat_prompt_template)
|
21 |
+
response = model.generate(chat_prompt_template, streamer=streamer, max_new_tokens=20)
|
22 |
return response
|
23 |
|
24 |
# Create a Gradio chatbot interface
|