diff --git a/app.py b/app.py index d1dd28cb..5e79b5b8 100755 --- a/app.py +++ b/app.py @@ -52,8 +52,6 @@ def demo_process(input_img): pretrained_model.half() device = torch.device("cuda") pretrained_model.to(device) - else: - pretrained_model.encoder.to(torch.bfloat16) pretrained_model.eval() diff --git a/donut/model.py b/donut/model.py index d5716964..271d97d7 100755 --- a/donut/model.py +++ b/donut/model.py @@ -443,8 +443,6 @@ def inference( if self.device.type == "cuda": # half is not compatible in cpu implementation. image_tensors = image_tensors.half() image_tensors = image_tensors.to(self.device) - else: - image_tensors = image_tensors.to(torch.bfloat16) if prompt_tensors is None: prompt_tensors = self.decoder.tokenizer(prompt, add_special_tokens=False, return_tensors="pt")["input_ids"] diff --git a/test.py b/test.py index 9ed64374..4d1b52aa 100755 --- a/test.py +++ b/test.py @@ -24,8 +24,6 @@ def test(args): if torch.cuda.is_available(): pretrained_model.half() pretrained_model.to("cuda") - else: - pretrained_model.encoder.to(torch.bfloat16) pretrained_model.eval()