Spaces:
Paused
Paused
revert: remove redundant max_new_tokens, model already has max_length=15
Browse files
modules/transcription/trocr_model.py
CHANGED
|
@@ -88,7 +88,7 @@ def transcribe_batch(cells: list[np.ndarray], batch_size: int | None = None) ->
|
|
| 88 |
chunk = images[i:i + bs]
|
| 89 |
pixel_values = _processor(chunk, return_tensors="pt").pixel_values.to(_device)
|
| 90 |
with torch.no_grad():
|
| 91 |
-
ids = _model.generate(pixel_values, num_beams=1, do_sample=False
|
| 92 |
results.extend(t.strip() for t in _processor.batch_decode(ids, skip_special_tokens=True))
|
| 93 |
return results
|
| 94 |
|
|
|
|
| 88 |
chunk = images[i:i + bs]
|
| 89 |
pixel_values = _processor(chunk, return_tensors="pt").pixel_values.to(_device)
|
| 90 |
with torch.no_grad():
|
| 91 |
+
ids = _model.generate(pixel_values, num_beams=1, do_sample=False)
|
| 92 |
results.extend(t.strip() for t in _processor.batch_decode(ids, skip_special_tokens=True))
|
| 93 |
return results
|
| 94 |
|