Spaces:
Paused
Paused
Download agent_zero_framework/tests/chunk_parser_test.py from Oldmangrizzz/Agent-Node: direct link, hf CLI and curl.
- Browser
- Download file 631 Bytes
-
https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/tests/chunk_parser_test.py
- Command line
-
hf download hf://spaces/Oldmangrizzz/Agent-Node/agent_zero_framework/tests/chunk_parser_test.py
-
curl -L -o chunk_parser_test.py https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/tests/chunk_parser_test.py
631 Bytes
| import sys | |
| import os | |
| sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| import models | |
| ex1 = "<think>reasoning goes here</think>response goes here" | |
| ex2 = "<think>reasoning goes here</thi" | |
| import pytest | |
| def test_example(example: str): | |
| res = models.ChatGenerationResult() | |
| for i in range(len(example)): | |
| char = example[i] | |
| chunk = res.add_chunk({"response_delta": char, "reasoning_delta": ""}) | |
| print(i, ":", chunk) | |
| print("output", res.output()) | |
| if __name__ == "__main__": | |
| # test_example(ex1) | |
| test_example(ex2) | |