Uses the conv template of the base model
(self, model_path: str)
| 660 | return model, tokenizer |
| 661 | |
| 662 | def get_default_conv_template(self, model_path: str) -> Conversation: |
| 663 | """Uses the conv template of the base model""" |
| 664 | from peft import PeftConfig, PeftModel |
| 665 | |
| 666 | config = PeftConfig.from_pretrained(model_path) |
| 667 | if "peft" in config.base_model_name_or_path: |
| 668 | raise ValueError( |
| 669 | f"PeftModelAdapter cannot load a base model with 'peft' in the name: {config.base_model_name_or_path}" |
| 670 | ) |
| 671 | base_model_path = config.base_model_name_or_path |
| 672 | base_adapter = get_model_adapter(base_model_path) |
| 673 | return base_adapter.get_default_conv_template(config.base_model_name_or_path) |
| 674 | |
| 675 | |
| 676 | class VicunaAdapter(BaseModelAdapter): |
nothing calls this directly
no test coverage detected