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

Method load_model

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

Source from the content-addressed store, hash-verified

2227 return "yuan" in model_path.lower()
2228
2229 def load_model(self, model_path: str, from_pretrained_kwargs: dict):
2230 model, tokenizer = super().load_model(model_path, from_pretrained_kwargs)
2231 tokenizer.add_tokens(
2232 [
2233 "<sep>",
2234 "<pad>",
2235 "<mask>",
2236 "<predict>",
2237 "<FIM_SUFFIX>",
2238 "<FIM_PREFIX>",
2239 "<FIM_MIDDLE>",
2240 "<commit_before>",
2241 "<commit_msg>",
2242 "<commit_after>",
2243 "<jupyter_start>",
2244 "<jupyter_text>",
2245 "<jupyter_code>",
2246 "<jupyter_output>",
2247 "<empty_output>",
2248 ],
2249 special_tokens=True,
2250 )
2251 return model, tokenizer
2252
2253 def get_default_conv_template(self, model_path: str) -> Conversation:
2254 return get_conv_template("yuan")

Callers

nothing calls this directly

Calls 1

load_modelMethod · 0.45

Tested by

no test coverage detected