Skip to content

Local dataset loading in reward model server #8

Closed
@aws-jiadingg

Description

@aws-jiadingg

In the RL training README.md, it mentions that we can specify dataset_path to load from a json dataset, i.e.:

bash scripts/train_reinforce_ray_rule_rm.sh # reinforcement++
...
# dataset_path="./data/acecode_87K/acecode_87K.json"
...

However, in the implementation, the dataset loading statement appears to only support loading from huggingface hub (missing the path="json" argument necessary to load from local?)

https://github.com/jdf-prog/OpenRLHF/blob/b2e2cdb4bcaa68baa73ed46e025e1051feed5e20/openrlhf/cli/serve_rm.py#L165

To properly load from a local JSON file, should the code be something like?:

# For local JSON files
if os.path.exists(args.dataset):
    self.dataset = datasets.load_dataset("json", data_files=args.dataset, split="train")
else:
    # Fallback to Hugging Face datasets
    self.dataset = datasets.load_dataset(args.dataset, split="train")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions