From 05a8fcb74f3143ec405607789b0fd6267918016c Mon Sep 17 00:00:00 2001 From: LZHgrla Date: Mon, 22 Apr 2024 11:22:54 +0800 Subject: [PATCH] fix pre-commit --- xtuner/tools/mmbench.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xtuner/tools/mmbench.py b/xtuner/tools/mmbench.py index fb519430b..c6a8dbc32 100644 --- a/xtuner/tools/mmbench.py +++ b/xtuner/tools/mmbench.py @@ -24,8 +24,7 @@ from transformers import (AutoModel, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, CLIPImageProcessor, CLIPVisionModel, GenerationConfig, - SiglipImageProcessor, SiglipVisionModel - ) + SiglipImageProcessor, SiglipVisionModel) from xtuner.dataset.utils import decode_base64_to_image, expand2square from xtuner.model.utils import LoadWoInit, prepare_inputs_labels_for_multimodal @@ -334,16 +333,18 @@ def main(): with LoadWoInit(): if 'clip' in visual_encoder_path: visual_encoder = CLIPVisionModel.from_pretrained( - visual_encoder_path, torch_dtype=TORCH_DTYPE_MAP[args.torch_dtype]) + visual_encoder_path, + torch_dtype=TORCH_DTYPE_MAP[args.torch_dtype]) image_processor = CLIPImageProcessor.from_pretrained( visual_encoder_path) elif 'siglip' in visual_encoder_path: visual_encoder = SiglipVisionModel.from_pretrained( - visual_encoder_path, torch_dtype=TORCH_DTYPE_MAP[args.torch_dtype]) + visual_encoder_path, + torch_dtype=TORCH_DTYPE_MAP[args.torch_dtype]) image_processor = SiglipImageProcessor.from_pretrained( visual_encoder_path) else: - raise f"Visual encoders not supported : {visual_encoder_path}" + raise f'Visual encoders not supported : {visual_encoder_path}' master_print(f'Load visual_encoder from {visual_encoder_path}')