Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -98,6 +98,13 @@ def summarize(text):
|
|
98 |
{"role": "system", "content": prompt.strip()},
|
99 |
{"role": "user", "content": text.strip()},
|
100 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
model_inputs = tokenizer([text], return_tensors="pt").to(device)
|
103 |
|
|
|
98 |
{"role": "system", "content": prompt.strip()},
|
99 |
{"role": "user", "content": text.strip()},
|
100 |
]
|
101 |
+
|
102 |
+
text = tokenizer.apply_chat_template(
|
103 |
+
messages,
|
104 |
+
tokenize=False,
|
105 |
+
add_generation_prompt=True,
|
106 |
+
enable_thinking=False, # only relevant for qwen
|
107 |
+
)
|
108 |
|
109 |
model_inputs = tokenizer([text], return_tensors="pt").to(device)
|
110 |
|