File size: 1,983 Bytes
e8055cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"""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"]
        )