Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -63,10 +63,13 @@ def stream_chat(
|
|
63 |
|
64 |
conversation.append({"role": "user", "content": message})
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
70 |
streamer = TextIteratorStreamer(tokenizer, timeout=60.0, skip_prompt=True, skip_special_tokens=True)
|
71 |
|
72 |
generate_kwargs = dict(
|
|
|
63 |
|
64 |
conversation.append({"role": "user", "content": message})
|
65 |
|
66 |
+
input_ids = tokenizer.apply_chat_template(
|
67 |
+
conversation,
|
68 |
+
tokenize=True,
|
69 |
+
add_generation_prompt=True,
|
70 |
+
return_tensors="pt"
|
71 |
+
).to(device)
|
72 |
+
|
73 |
streamer = TextIteratorStreamer(tokenizer, timeout=60.0, skip_prompt=True, skip_special_tokens=True)
|
74 |
|
75 |
generate_kwargs = dict(
|