| 36 | |
| 37 | |
| 38 | class DummyDataProcessor: |
| 39 | def __init__(self, vocab_size: int): |
| 40 | self.tokenizer = DummyTokenizer(vocab_size) |
| 41 | |
| 42 | def process_logprob_response(self, token_ids, clean_up_tokenization_spaces: bool = False): |
| 43 | return f"tok_{token_ids[0]}" |
| 44 | |
| 45 | def process_response(self, result): |
| 46 | return result |
| 47 | |
| 48 | def process_response_dict_streaming(self, response_dict, stream, enable_thinking, include_stop_str_in_output): |
| 49 | tokens = "".join(f"tok_{tid}" for tid in response_dict["outputs"]["token_ids"]) |
| 50 | return {"outputs": {"text": f"think:{tokens}" if enable_thinking else tokens}} |
| 51 | |
| 52 | |
| 53 | class DummyResult: |