| 125 | |
| 126 | |
| 127 | class TogetherComputerChat(PromptStyle): |
| 128 | def apply(self, prompt: str, **kwargs: str) -> str: |
| 129 | return f'<human>: {prompt}\n<bot>:' |
| 130 | |
| 131 | def stop_tokens(self, tokenizer: 'Tokenizer') -> Tuple[List[int], ...]: |
| 132 | lt, gt = tokenizer.token_to_id('<'), tokenizer.token_to_id('>:') |
| 133 | return ( |
| 134 | [tokenizer.eos_id], |
| 135 | # annoyingly, there's no single stop token for these |
| 136 | [lt, tokenizer.token_to_id('human'), gt], |
| 137 | [lt, tokenizer.token_to_id('bot'), gt], |
| 138 | ) |
| 139 | |
| 140 | |
| 141 | class TogetherComputerInstruct(PromptStyle): |
no outgoing calls
no test coverage detected