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

Class TogetherComputerChat

lit_gpt/prompts.py:127–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125
126
127class 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
141class TogetherComputerInstruct(PromptStyle):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected