feat:openenv rollout_func (#3239) [skip ci]

* feat:openenv rollout_func

* chore lint

* docs

* add:docs processing_class

* tests

* lint
This commit is contained in:
VED
2025-11-07 19:21:40 +05:30
committed by GitHub
parent 80270a92fa
commit ed2e8cacd6
4 changed files with 168 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import os
import pytest
from axolotl.core.trainers.grpo import GRPOStrategy
def test_get_rollout_func_loads_successfully():
"""Test that a valid rollout function can be loaded"""
rollout_func = GRPOStrategy.get_rollout_func("os.path.join")
assert callable(rollout_func)
assert rollout_func == os.path.join
def test_get_rollout_func_invalid_module_raises_error():
"""Test that invalid module path raises clear ValueError"""
with pytest.raises(ValueError, match="Rollout function .* not found"):
GRPOStrategy.get_rollout_func("nonexistent_module.my_func")