def from_model_name(cls, model_name: str, **kwargs: Any) -> "HuggingFaceMultiModal":
        """Checks the model architecture and initializes the model."""
        config = AutoConfig.from_pretrained(model_name, trust_remote_code=True)
        # we check the architecture because users would want to use their own finetuned versions of VLMs
        architecture = config.architectures[0]

        if "Phi3VForCausalLM" in architecture:
            return Phi35VisionMultiModal(model_name=model_name, **kwargs)
        elif "Florence2ForConditionalGeneration" in architecture:
            return Florence2MultiModal(model_name=model_name, **kwargs)
        elif "Qwen2VLForConditionalGeneration" in architecture:
            return Qwen2VisionMultiModal(model_name=model_name, **kwargs)
        elif "PaliGemmaForConditionalGeneration" in architecture:
            return PaliGemmaMultiModal(model_name=model_name, **kwargs)
        elif "MllamaForConditionalGeneration" in architecture:
            return LlamaMultiModal(model_name=model_name, **kwargs)
        else:
            raise ValueError(
                f"Unsupported model architecture: {architecture}. "
                f"We currently support: {', '.join(SUPPORTED_VLMS)}"
            )
Checks the model architecture and initializes the model.
llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-huggingface/llama_index/multi_modal_llms/huggingface/base.py