MCPcopy Index your code
hub / github.com/lm-sys/FastChat / load_model

Method load_model

fastchat/model/model_adapter.py:729–742  ·  view source on GitHub ↗
(self, model_path: str, from_pretrained_kwargs: dict)

Source from the content-addressed store, hash-verified

727 return get_conv_template("airoboros_v1")
728
729 def load_model(self, model_path: str, from_pretrained_kwargs: dict):
730 if "mpt" not in model_path.lower():
731 return super().load_model(model_path, from_pretrained_kwargs)
732 model = AutoModelForCausalLM.from_pretrained(
733 model_path,
734 low_cpu_mem_usage=True,
735 trust_remote_code=True,
736 max_seq_len=8192,
737 **from_pretrained_kwargs,
738 )
739 tokenizer = AutoTokenizer.from_pretrained(
740 model_path, trust_remote_code=True, use_fast=True
741 )
742 return model, tokenizer
743
744
745class LongChatAdapter(BaseModelAdapter):

Callers

nothing calls this directly

Calls 1

load_modelMethod · 0.45

Tested by

no test coverage detected