Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
17 lines
457 B
Python
17 lines
457 B
Python
from compare import compare
|
|
|
|
|
|
def test_compare_empty_texts():
|
|
result = compare(
|
|
prompt_template="Classify: {text}",
|
|
texts=[],
|
|
teacher_labels={},
|
|
eval_results=None,
|
|
count_tokens=lambda s: max(1, len(s) // 4),
|
|
token_method="test",
|
|
num_examples=3,
|
|
)
|
|
assert result["teacher_input_avg"] == 0.0
|
|
assert result["student_input_avg"] == 0.0
|
|
assert result["input_token_reduction_pct"] == 0.0
|