MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / TogetherComputerInstruct

Class TogetherComputerInstruct

lit_gpt/prompts.py:141–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139
140
141class TogetherComputerInstruct(PromptStyle):
142 def apply(self, prompt: str, **kwargs: str) -> str:
143 return f'Q: {prompt}\nA:'
144
145 def stop_tokens(self, tokenizer: 'Tokenizer') -> Tuple[List[int], ...]:
146 colon = tokenizer.token_to_id(':')
147 return (
148 [tokenizer.eos_id],
149 # annoyingly, there's no single stop token for these
150 [tokenizer.token_to_id('Q'), colon],
151 [tokenizer.token_to_id('Question')],
152 [tokenizer.token_to_id('A'), colon],
153 [tokenizer.token_to_id('Label'), colon],
154 [187, 187], # '\n', '\n'
155 [535], # '\n\n'
156 [2756], # '\n\n\n'
157 )
158
159
160class Falcon(PromptStyle):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected