Spaces:
Runtime error
Runtime error
JosephusCheung
commited on
Commit
β’
803a940
1
Parent(s):
9b70592
Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,7 @@ def stream_chat(message: str, history: list, temperature: float, max_length: int
|
|
47 |
print(f"Conversation is -\n{conversation}")
|
48 |
|
49 |
input_ids = tokenizer.apply_chat_template(conversation, tokenize=True, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
|
50 |
-
streamer = TextIteratorStreamer(tokenizer,
|
51 |
|
52 |
generate_kwargs = dict(
|
53 |
max_length=max_length,
|
|
|
47 |
print(f"Conversation is -\n{conversation}")
|
48 |
|
49 |
input_ids = tokenizer.apply_chat_template(conversation, tokenize=True, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
|
50 |
+
streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
51 |
|
52 |
generate_kwargs = dict(
|
53 |
max_length=max_length,
|