Model adapater for tool-llama
| 247 | |
| 248 | |
| 249 | class ToolLlamaAdapter(BaseAdapter): |
| 250 | "Model adapater for tool-llama" |
| 251 | |
| 252 | def match(self, model_path: str): |
| 253 | return "tool-llama" == model_path |
| 254 | |
| 255 | def load_model(self, model_path: str, from_pretrained_kwargs: dict): |
| 256 | tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False) |
| 257 | model = AutoModelForCausalLM.from_pretrained( |
| 258 | model_path, |
| 259 | low_cpu_mem_usage=True, |
| 260 | **from_pretrained_kwargs, |
| 261 | ) |
| 262 | return model, tokenizer |
| 263 | |
| 264 | def get_default_conv_template(self, model_path: str) -> Conversation: |
| 265 | return get_conv_template("tool-llama") |
| 266 | |
| 267 | class ToolLlamaAdapterSingleRound(BaseAdapter): |
| 268 | "Model adapater for tool-llama-single-round" |
nothing calls this directly
no outgoing calls
no test coverage detected