Update app.py
Browse files
app.py
CHANGED
|
@@ -241,6 +241,8 @@ def generate(
|
|
| 241 |
return_dict=True,
|
| 242 |
return_tensors="pt"
|
| 243 |
).to(aya_model.device)
|
|
|
|
|
|
|
| 244 |
gen_tokens = aya_model.generate(
|
| 245 |
**inputs,
|
| 246 |
max_new_tokens=300,
|
|
@@ -369,7 +371,6 @@ demo = gr.ChatInterface(
|
|
| 369 |
gr.Slider(label="Repetition penalty", minimum=1.0, maximum=2.0, step=0.05, value=1.2),
|
| 370 |
],
|
| 371 |
examples=[
|
| 372 |
-
|
| 373 |
[{"text": "@aya-vision Extract JSON from the image", "files": ["examples/document.jpg"]}],
|
| 374 |
[{"text": "@aya-vision Summarize the letter", "files": ["examples/1.png"]}],
|
| 375 |
["@tts1 Who is Nikola Tesla, and why did he die?"],
|
|
|
|
| 241 |
return_dict=True,
|
| 242 |
return_tensors="pt"
|
| 243 |
).to(aya_model.device)
|
| 244 |
+
# Remove deprecated parameter if present to avoid conflicts.
|
| 245 |
+
inputs.pop("num_logits_to_keep", None)
|
| 246 |
gen_tokens = aya_model.generate(
|
| 247 |
**inputs,
|
| 248 |
max_new_tokens=300,
|
|
|
|
| 371 |
gr.Slider(label="Repetition penalty", minimum=1.0, maximum=2.0, step=0.05, value=1.2),
|
| 372 |
],
|
| 373 |
examples=[
|
|
|
|
| 374 |
[{"text": "@aya-vision Extract JSON from the image", "files": ["examples/document.jpg"]}],
|
| 375 |
[{"text": "@aya-vision Summarize the letter", "files": ["examples/1.png"]}],
|
| 376 |
["@tts1 Who is Nikola Tesla, and why did he die?"],
|