Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -77,8 +77,8 @@ def stream_chat(
|
|
77 |
model = model2
|
78 |
tokenizer = tokenizer2
|
79 |
|
80 |
-
input_text=tokenizer.apply_chat_template(conversation, tokenize=False)
|
81 |
-
inputs = tokenizer.encode(input_text,
|
82 |
streamer = TextIteratorStreamer(tokenizer, timeout=60.0, skip_prompt=True, skip_special_tokens=True)
|
83 |
|
84 |
generate_kwargs = dict(
|
|
|
77 |
model = model2
|
78 |
tokenizer = tokenizer2
|
79 |
|
80 |
+
input_text=tokenizer.apply_chat_template(conversation, add_generation_prompt=True, tokenize=False)
|
81 |
+
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
|
82 |
streamer = TextIteratorStreamer(tokenizer, timeout=60.0, skip_prompt=True, skip_special_tokens=True)
|
83 |
|
84 |
generate_kwargs = dict(
|