| 139 | |
| 140 | |
| 141 | class 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 | |
| 160 | class Falcon(PromptStyle): |
no outgoing calls
no test coverage detected