Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ def invoke(input_text, model, tokenizer):
|
|
| 15 |
|
| 16 |
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 17 |
inputs = tokenizer(prompt, return_tensors='pt', padding=True, truncation=True)
|
| 18 |
-
outputs = model.generate(**inputs, max_new_tokens=
|
| 19 |
|
| 20 |
text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 21 |
text = text.split("assistant")[1]
|
|
|
|
| 15 |
|
| 16 |
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 17 |
inputs = tokenizer(prompt, return_tensors='pt', padding=True, truncation=True)
|
| 18 |
+
outputs = model.generate(**inputs, max_new_tokens=500, num_return_sequences=1)
|
| 19 |
|
| 20 |
text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 21 |
text = text.split("assistant")[1]
|