transformers/examples/modular-transformers/modular_new_imgproc_model.py
Yoni Gozlan 3a8eb74668
Fix support for image processors modifications in modular (#34866)
* add fix and examples

* fix camel case naming
2024-11-22 18:14:24 -05:00

10 lines
286 B
Python

import torch
import torch.utils.checkpoint
from transformers.models.blip.image_processing_blip import BlipImageProcessor
class ImgprocModelImageProcessor(BlipImageProcessor):
def new_image_processing_method(self, pixel_values: torch.FloatTensor):
return pixel_values / 2