Spaces:
Sleeping
Sleeping
Fix dict access for input_ids in generation trim
Browse files
app.py
CHANGED
|
@@ -105,7 +105,7 @@ def diagnose_ecg(image: Image.Image = None, temp: float = 0.4, max_tokens: int =
|
|
| 105 |
generated_ids = model.generate(**inputs, max_new_tokens=int(max_tokens), temperature=float(temp), top_p=0.9, do_sample=True)
|
| 106 |
|
| 107 |
generated_ids_trimmed = [
|
| 108 |
-
out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs
|
| 109 |
]
|
| 110 |
|
| 111 |
output_text = processor.batch_decode(generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
|
|
|
| 105 |
generated_ids = model.generate(**inputs, max_new_tokens=int(max_tokens), temperature=float(temp), top_p=0.9, do_sample=True)
|
| 106 |
|
| 107 |
generated_ids_trimmed = [
|
| 108 |
+
out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs["input_ids"], generated_ids)
|
| 109 |
]
|
| 110 |
|
| 111 |
output_text = processor.batch_decode(generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|