Loads a single tool
(self, tool_type,
# new options added
use_gpu=True, sample=False, get_logits=True,
max_output=100, temperature=0.0)
| 431 | return output_list |
| 432 | |
| 433 | def load_tool(self, tool_type, |
| 434 | # new options added |
| 435 | use_gpu=True, sample=False, get_logits=True, |
| 436 | max_output=100, temperature=0.0): |
| 437 | |
| 438 | """ Loads a single tool """ |
| 439 | |
| 440 | model = None |
| 441 | |
| 442 | if not self.api_exec: |
| 443 | |
| 444 | if tool_type in self._supported_tools: |
| 445 | |
| 446 | journal_update = f"loading tool - {tool_type}" |
| 447 | self.write_to_journal(journal_update) |
| 448 | |
| 449 | setattr(self, tool_type + "_model", |
| 450 | ModelCatalog().load_model(self._default_tool_map[tool_type],api_key=self.api_key, |
| 451 | sample=sample,use_gpu=use_gpu,get_logits=get_logits,max_output=max_output, |
| 452 | temperature=temperature)) |
| 453 | |
| 454 | model = getattr(self, tool_type + "_model") |
| 455 | |
| 456 | if tool_type not in self.tools_deployed: |
| 457 | self.tools_deployed.append(tool_type) |
| 458 | |
| 459 | else: |
| 460 | journal_update = f"api_exec mode = 'ON' - skipping - local loading of tool - {tool_type}" |
| 461 | self.write_to_journal(journal_update) |
| 462 | |
| 463 | return model |
| 464 | |
| 465 | def load_tool_list(self, tool_list): |
| 466 |