class_docstr: A testing suite that makes sure that the PeftModel class is correctly integrated into the transformers library.
class_docstr_tok: ["A","testing","suite","that","makes","sure","that","the","PeftModel","class","is","correctly","integrated","into","the","transformers","library","."]
docstr: Utility method to check if the model has correctly adapters injected on it.
docstr_tok: ["Utility","method","to","check","if","the","model","has","correctly","adapters","injected","on","it","."]
code: def _check_lora_correctly_converted(self, model):
      """
      Utility method to check if the model has correctly adapters injected on it.
      """
      from peft.tuners.tuners_utils import BaseTunerLayer
  
      is_peft_loaded = False
  
      for _, m in model.named_modules():
          if isinstance(m, BaseTunerLayer):
              is_peft_loaded = True
              break
  
      return is_peft_loaded
  
imports: import os
  import tempfile
  import unittest
  from huggingface_hub import hf_hub_download
  from transformers import AutoModelForCausalLM, OPTForCausalLM
  from transformers.testing_utils import require_peft, require_torch, require_torch_gpu, slow, torch_device
  from transformers.utils import is_torch_available
label_desc: Use image node_id 1 for calling the PeftIntegrationTester obj's underlying member method code with example usage: obj._check_lora_correctly_converted(model) and returns: is_peft_loaded