Repository: lm-sys/FastChat
File: fastchat/model/model_adapter.py (Python)

Code before:
        return "redpajama-incite" in model_path.lower()

    def load_model(self, model_path: str, from_pretrained_kwargs: dict):
        tokenizer = AutoTokenizer.from_pretrained(model_path)  # no use_fast=False
        model = AutoModelForCausalLM.from_pretrained(
            model_path,
            low_cpu_mem_usage=True,
            **from_pretrained_kwargs,
        )
        return model, tokenizer

    def get_default_conv_template(self, model_path: str) -> Conversation:
        return get_conv_template("redpajama-incite")


class H2OGPTAdapter(BaseAdapter):
    """The model adapter for h2oGPT."""

    def match(self, model_path: str):
        return "h2ogpt" in model_path.lower()

    def get_default_conv_template(self, model_path: str) -> Conversation:
        return get_conv_template("h2ogpt")

class RobinAdapter(BaseAdapter):
    """The model adapter for LMFlow/Full-Robin-7b-v2"""

    def match(self,model_path:str):
        return "Robin" in model_path

    def get_default_conv_template(self,model_path:str) -> Conversation:
        return get_conv_template("Robin")

class SnoozyAdapter(BaseAdapter):
    """The model adapter for nomic-ai/gpt4all-13b-snoozy"""

    def match(self, model_path: str):
        return "gpt4all" in model_path and "snoozy" in model_path

    def get_default_conv_template(self, model_path: str) -> Conversation:
        return get_conv_template("snoozy")


class WizardLMAdapter(BaseAdapter):
    """The model adapter for WizardLM/WizardLM-13B-V1.0"""

    def match(self, model_path: str):
        return "wizardlm" in model_path.lower()

    def get_default_conv_template(self, model_path: str) -> Conversation:
        model_path = model_path.lower()

Review comment (suggestion):
```suggestion

class RobinAdapter(BaseAdapter):
```

Code after:
        return "redpajama-incite" in model_path.lower()

    def load_model(self, model_path: str, from_pretrained_kwargs: dict):
        tokenizer = AutoTokenizer.from_pretrained(model_path)  # no use_fast=False
        model = AutoModelForCausalLM.from_pretrained(
            model_path,
            low_cpu_mem_usage=True,
            **from_pretrained_kwargs,
        )
        return model, tokenizer

    def get_default_conv_template(self, model_path: str) -> Conversation:
        return get_conv_template("redpajama-incite")


class H2OGPTAdapter(BaseAdapter):
    """The model adapter for h2oGPT."""

    def match(self, model_path: str):
        return "h2ogpt" in model_path.lower()

    def get_default_conv_template(self, model_path: str) -> Conversation:
        return get_conv_template("h2ogpt")


class RobinAdapter(BaseAdapter):
    """The model adapter for LMFlow/Full-Robin-7b-v2"""

    def match(self,model_path:str):
        return "Robin" in model_path

    def get_default_conv_template(self,model_path:str) -> Conversation:
        return get_conv_template("Robin")


class SnoozyAdapter(BaseAdapter):
    """The model adapter for nomic-ai/gpt4all-13b-snoozy"""

    def match(self, model_path: str):
        return "gpt4all" in model_path and "snoozy" in model_path

    def get_default_conv_template(self, model_path: str) -> Conversation:
        return get_conv_template("snoozy")


class WizardLMAdapter(BaseAdapter):
    """The model adapter for WizardLM/WizardLM-13B-V1.0"""

    def match(self, model_path: str):
        return "wizardlm" in model_path.lower()