Skip to content

Commit

Permalink
fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LZHgrla committed Apr 22, 2024
1 parent a8cc1a6 commit 05a8fcb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions xtuner/tools/mmbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}')

Expand Down

0 comments on commit 05a8fcb

Please # to comment.