From 04a4bddd9757182dbd126f592933e642e3c08f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E6=B4=8B=E4=B8=89=E6=B4=8B?= <1258009915@qq.com> Date: Mon, 4 Mar 2024 05:38:30 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86functional.py?= =?UTF-8?q?=E4=B8=AD=E7=9A=84tokenize=5Ffn(=E5=9B=BE=E7=89=87=E4=BB=A5png?= =?UTF-8?q?=E5=BD=A2=E5=BC=8F=E8=80=8C=E9=9D=9E=E6=95=B0=E7=BB=84=E7=9A=84?= =?UTF-8?q?=E5=BD=A2=E5=BC=8F=E4=BF=9D=E5=AD=98=EF=BC=8C=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E5=8D=A0=E7=94=A8=E8=BF=87=E5=A4=9A=E7=A1=AC=E7=9B=98=E7=A9=BA?= =?UTF-8?q?=E9=97=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/ocr_model/utils/functional.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/ocr_model/utils/functional.py b/src/models/ocr_model/utils/functional.py index 92f40c0..969a493 100644 --- a/src/models/ocr_model/utils/functional.py +++ b/src/models/ocr_model/utils/functional.py @@ -21,7 +21,7 @@ def left_move(x: torch.Tensor, pad_val): def tokenize_fn(samples: Dict[str, List[Any]], tokenizer=None) -> Dict[str, List[Any]]: assert tokenizer is not None, 'tokenizer should not be None' tokenized_formula = tokenizer(samples['latex_formula'], return_special_tokens_mask=True) - tokenized_formula['pixel_values'] = [np.array(sample) for sample in samples['image']] + tokenized_formula['pixel_values'] = samples['image'] return tokenized_formula