mirror of
https://github.com/huggingface/lerobot.git
synced 2026-08-08 17:39:44 +00:00
refactor(g05): keep recipe runtime unchanged
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user