(self, name="BaseLLMNode", model_name="text-davinci-003", stop=None, input_type=str, output_type=str)
| 115 | |
| 116 | class LLMNode(Node): |
| 117 | def __init__(self, name="BaseLLMNode", model_name="text-davinci-003", stop=None, input_type=str, output_type=str): |
| 118 | super().__init__(name, input_type, output_type) |
| 119 | self.model_name = model_name |
| 120 | self.stop = stop |
| 121 | |
| 122 | # Initialize to load shards only once |
| 123 | if self.model_name in LLAMA_WEIGHTS: |
| 124 | self.al = AlpacaLora(lora_weights=self.model_name) |
| 125 | |
| 126 | def run(self, input, log=False): |
| 127 | assert isinstance(input, self.input_type) |