Spaces:
Sleeping
Sleeping
alfredplpl
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -69,12 +69,12 @@ def chat_llama3_8b(message: str,
|
|
69 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
70 |
conversation.append({"role": "user", "content": message})
|
71 |
|
72 |
-
input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
|
73 |
|
74 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|
75 |
|
76 |
generate_kwargs = dict(
|
77 |
-
input_ids= input_ids,
|
78 |
streamer=streamer,
|
79 |
max_new_tokens=max_new_tokens,
|
80 |
do_sample=True,
|
|
|
69 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
70 |
conversation.append({"role": "user", "content": message})
|
71 |
|
72 |
+
input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
|
73 |
|
74 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|
75 |
|
76 |
generate_kwargs = dict(
|
77 |
+
input_ids= input_ids.to(model.device),
|
78 |
streamer=streamer,
|
79 |
max_new_tokens=max_new_tokens,
|
80 |
do_sample=True,
|