Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds support for override compute path #323

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion verl/trainer/main_ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@

@hydra.main(config_path='config', config_name='ppo_trainer', version_base=None)
def main(config):
run_ppo(config)
# Get the compute_score_path and import custom reward function if provided
compute_score_path = config.get('compute_score_path', None)
compute_score = None
if compute_score_path:
module_path, function_name = compute_score_path.rsplit('.', 1)
import importlib
module = importlib.import_module(module_path)
compute_score = getattr(module, function_name)

run_ppo(config, compute_score)


def run_ppo(config, compute_score=None):
Expand Down
Loading