gregorlied commited on
Commit
04f9c0f
Β·
verified Β·
1 Parent(s): e4075e2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
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