The get_model_cls_by_arch_name introduced in Dynamic model class loading PR removes the hard-coded mapping between MistralForCausalLM and LlamaForCausalLM causing issues trying to local host Mistral-7b model as of sglang version 0.1.9. I have tested that adding the following simple models/mistral.py file allows hosting the mistral-7b model.
from sglang.srt.models.llama2 import LlamaForCausalLM
class MistralForCausalLM(LlamaForCausalLM):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
EntryClass = MistralForCausalLM
The
get_model_cls_by_arch_nameintroduced in Dynamic model class loading PR removes the hard-coded mapping betweenMistralForCausalLMandLlamaForCausalLMcausing issues trying to local host Mistral-7b model as of sglang version 0.1.9. I have tested that adding the following simplemodels/mistral.pyfile allows hosting the mistral-7b model.