Spaces:
Sleeping
Sleeping
Download tests/test_enhancer.py from Jplayz/peerpixel-runner: direct link, hf CLI and curl.
- Browser
- Download file 470 Bytes
-
https://huggingface.co/spaces/Jplayz/peerpixel-runner/resolve/main/tests/test_enhancer.py
- Command line
-
hf download hf://spaces/Jplayz/peerpixel-runner/tests/test_enhancer.py
-
curl -L -o test_enhancer.py https://huggingface.co/spaces/Jplayz/peerpixel-runner/resolve/main/tests/test_enhancer.py
470 Bytes
| import enhancer | |
| class FakeTokenizer: | |
| def apply_chat_template(self, messages, **kwargs): return {"input_ids": [[1, 2]]} | |
| def decode(self, tokens, **kwargs): return "a cinematic red fox in morning fog" | |
| class FakeModel: | |
| def generate(self, **kwargs): return [[1, 2, 3, 4]] | |
| def test_prompt_enhancer_returns_only_new_model_text(): | |
| assert enhancer.enhance_prompt("fox", tokenizer=FakeTokenizer(), model=FakeModel()) == "a cinematic red fox in morning fog" | |