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

Method load_model

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

Source from the content-addressed store, hash-verified

1513 return "llama-2" in model_path.lower()
1514
1515 def load_model(self, model_path: str, from_pretrained_kwargs: dict):
1516 model, tokenizer = super().load_model(model_path, from_pretrained_kwargs)
1517 model.config.eos_token_id = tokenizer.eos_token_id
1518 model.config.pad_token_id = tokenizer.pad_token_id
1519 return model, tokenizer
1520
1521 def get_default_conv_template(self, model_path: str) -> Conversation:
1522 return get_conv_template("llama-2")

Callers

nothing calls this directly

Calls 1

load_modelMethod · 0.45

Tested by

no test coverage detected