refactor(g05): keep recipe runtime unchanged

This commit is contained in:
Pepijn
2026-07-29 15:59:38 +02:00
parent 3dee8e640a
commit fe4497ba27
7 changed files with 19 additions and 157 deletions
+1 -14
View File
@@ -47,17 +47,6 @@ def test_message_turn_requires_a_stream():
MessageTurn(role="user", content="${task}")
@pytest.mark.parametrize("dropout", [-0.1, 1.1, float("inf"), float("nan")])
def test_message_turn_rejects_invalid_dropout(dropout):
with pytest.raises(ValueError, match="between 0 and 1"):
MessageTurn(role="user", content="${task}", stream="high_level", dropout=dropout)
def test_message_turn_rejects_non_numeric_dropout():
with pytest.raises(TypeError, match="probability"):
MessageTurn(role="user", content="${task}", stream="high_level", dropout="half")
def test_message_recipe_requires_at_least_one_target():
with pytest.raises(ValueError, match="target"):
TrainingRecipe(
@@ -163,7 +152,7 @@ def test_from_dict_with_nested_blend():
assert isinstance(recipe.blend["a"].messages[0], MessageTurn)
def test_message_dropout_round_trips_from_dict():
def test_message_if_present_round_trips_from_dict():
recipe = TrainingRecipe.from_dict(
{
"messages": [
@@ -174,13 +163,11 @@ def test_message_dropout_round_trips_from_dict():
"stream": "low_level",
"target": True,
"if_present": "subtask",
"dropout": 0.5,
},
]
}
)
assert recipe.messages[1].dropout == 0.5
assert recipe.messages[1].if_present == "subtask"