leideng/QCFuse / srt /configs /utils.py
leideng's picture
download
raw
670 Bytes
from typing import Type
from transformers import (
AutoImageProcessor,
AutoProcessor,
BaseImageProcessor,
PretrainedConfig,
ProcessorMixin,
)
def register_image_processor(
config: Type[PretrainedConfig], image_processor: Type[BaseImageProcessor]
):
"""
register customized hf image processor while removing hf impl
"""
AutoImageProcessor.register(config, None, image_processor, None, exist_ok=True)
def register_processor(config: Type[PretrainedConfig], processor: Type[ProcessorMixin]):
"""
register customized hf processor while removing hf impl
"""
AutoProcessor.register(config, processor, exist_ok=True)

Xet Storage Details

Size:
670 Bytes
·
Xet hash:
10b94afdf9740c4e23382c47176920ebae6fa816f1e3fe10efb1ab083efc9385

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.