Model adapater for tool-llama-single-round
| 265 | return get_conv_template("tool-llama") |
| 266 | |
| 267 | class ToolLlamaAdapterSingleRound(BaseAdapter): |
| 268 | "Model adapater for tool-llama-single-round" |
| 269 | |
| 270 | def match(self, model_path: str): |
| 271 | return "tool-llama-single-round" == model_path |
| 272 | |
| 273 | def load_model(self, model_path: str, from_pretrained_kwargs: dict): |
| 274 | tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False, model_max_length=8192) |
| 275 | model = AutoModelForCausalLM.from_pretrained( |
| 276 | model_path, |
| 277 | low_cpu_mem_usage=True, |
| 278 | **from_pretrained_kwargs, |
| 279 | ) |
| 280 | return model, tokenizer |
| 281 | |
| 282 | def get_default_conv_template(self, model_path: str) -> Conversation: |
| 283 | return get_conv_template("tool-llama-single-round") |
| 284 | |
| 285 | |
| 286 | # Note: the registration order matters. |
nothing calls this directly
no outgoing calls
no test coverage detected