workspace / tests /test_A /test_init.py
AntonioJun's picture
Replace tests with local workspace contents
e8055cf verified
Raw
History Blame Contribute Delete
1.98 kB
"""Tests for harness/A/__init__.py -- shared config constants."""
from pathlib import Path
from harness import A
def test_generation_protocol_matches_vsibench_yaml():
# thinking-in-space/lmms_eval/tasks/vsibench/vsibench.yaml generation_kwargs.
assert A.MAX_NEW_TOKENS == 16
assert A.TEMPERATURE == 0.0
assert A.DO_SAMPLE is False
def test_thinking_generation_protocol():
assert A.EXTENDED_MAX_NEW_TOKENS == 2048
assert A.EXTENDED_MAX_NEW_TOKENS > A.MAX_NEW_TOKENS
assert isinstance(A.FORCE_ANSWER_PROMPT, str) and A.FORCE_ANSWER_PROMPT.strip()
def test_frame_selections_match_inference_vocabulary():
from inference import SAM3_FRAME_SELECTIONS
assert A.FRAME_SELECTIONS == SAM3_FRAME_SELECTIONS
def test_default_frame_selection_is_a_valid_selection():
assert A.DEFAULT_FRAME_SELECTION in A.FRAME_SELECTIONS
def test_model_paths_cover_every_registered_model():
assert set(A.MODEL_PATHS) == {
"qwen3.5-4b",
"qwen3.5-2b",
"internvl3.5-4b",
"internvl3.5-2b",
}
for path in A.MODEL_PATHS.values():
assert path.parent == A.MODELS_ROOT
def test_results_dir_defaults_under_root_results():
assert A.RESULTS_DIR == Path("/root/results/A")
def test_question_protocol_policy_is_hardcoded_by_group():
assert A.question_group("object_counting") == "numerical"
assert A.protocol_for_question("object_counting") == "base"
assert A.question_group("route_planning") == "multiple_choice"
assert A.protocol_for_question("route_planning") == "thinking"
def test_every_known_question_type_has_one_policy_group():
for question_type in A.NUMERICAL_QUESTION_TYPES:
assert (
A.protocol_for_question(question_type) == A.QUESTION_PROTOCOLS["numerical"]
)
for question_type in A.MULTIPLE_CHOICE_QUESTION_TYPES:
assert (
A.protocol_for_question(question_type)
== A.QUESTION_PROTOCOLS["multiple_choice"]
)