MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / DummyDataProcessor

Class DummyDataProcessor

tests/entrypoints/test_llm.py:38–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37
38class 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
53class DummyResult:

Callers 1

_make_engineFunction · 0.85

Calls

no outgoing calls

Tested by 1

_make_engineFunction · 0.68