Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,12 @@ if st.button("Send"):
|
|
| 37 |
st.session_state.history.append(("You", prompt))
|
| 38 |
|
| 39 |
chat = [{"role": "user", "content": prompt}]
|
| 40 |
-
inputs = tokenizer.apply_chat_template(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
with torch.no_grad():
|
| 43 |
output = model.generate(
|
|
|
|
| 37 |
st.session_state.history.append(("You", prompt))
|
| 38 |
|
| 39 |
chat = [{"role": "user", "content": prompt}]
|
| 40 |
+
inputs = tokenizer.apply_chat_template(
|
| 41 |
+
chat,
|
| 42 |
+
add_generation_prompt=True,
|
| 43 |
+
return_tensors="pt",
|
| 44 |
+
return_dict=True # ← this is the key
|
| 45 |
+
)
|
| 46 |
|
| 47 |
with torch.no_grad():
|
| 48 |
output = model.generate(
|