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

[WIP] in-loop task evaluator compatible from oe-eval-internal #72

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lihaoxin2020
Copy link
Collaborator

This PR adds in-loop task evaluator callbacks, mostly borrow from OLMo repo and compatible with oe-eval-internal.

I implemented this for an ongoing project and I think it would be useful for the community, so i publish the draft to show the framework. If the team thinks it's worth adding the feature I would like to help refine it.

To use the evaluator, add the callback just like LMEvaluator:

downstream_evaluators = [
    "pubmedqa_mc",
    "scifact_rc",
]

trainer_config = (
    TrainerConfig(
        ...
    ).with_callback(
        "evaluator",
        LMEvaluatorCallbackConfig(
            eval_dataset=NumpyDatasetConfig(
                paths=["/net/nfs/allennlp/llm-data/c4/en/c4-validation.00000-00008.npy"],
                metadata=[{"label": "c4-validation"}],
                name=NumpyDatasetType.padded_fsl,
                sequence_length=1024,
                tokenizer=tokenizer_config,
                work_dir="/tmp/dataset-cache",
            ),
            eval_interval=250,
            eval_duration=Duration.steps(10),
        ),
    ).with_callback(
        "downstream",
        DownstreamEvaluatorCallbackConfig(
            labels=downstream_evaluators,
            eval_batch_size=4,
            tokenizer="meta-llama/Llama-2-7b-hf",  # tokenizer implementation from OMLo
            eval_interval=10,
            # eval_duration=Duration.steps(10),
        ),
    )
)

Let me know if you think it's useful to have this in main.

epwalsh added a commit that referenced this pull request Oct 30, 2024
Replaces #72. Gives us complete parity with the original downstream
evals in the OLMo repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant