Skip to content

Conversation

clefourrier
Copy link
Member

@clefourrier clefourrier commented Nov 12, 2024

To test the PR

import lighteval
import os
from datetime import timedelta
from transformers import AutoModelForCausalLM

from lighteval.logging.evaluation_tracker import EvaluationTracker
from lighteval.logging.hierarchical_logger import hlog_warn, htrack
from lighteval.models.model_config import create_model_config
from lighteval.pipeline import EnvConfig, ParallelismManager, Pipeline, PipelineParameters
from lighteval.utils.imports import is_accelerate_available, is_tgi_available

TOKEN = os.getenv("HF_TOKEN")
    
model = AutoModelForCausalLM.from_pretrained("trl-lib/Qwen2-0.5B-DPO")

env_config = EnvConfig(token=TOKEN, cache_dir="~/tmp")
evaluation_tracker = EvaluationTracker(
    output_dir="~/tmp",
    save_details=False,
    push_to_hub=False,
    push_to_tensorboard=False,
    public=False,
    hub_results_org=False,
)
pipeline_params = PipelineParameters(
    launcher_type=ParallelismManager.ACCELERATE,
    env_config=env_config,
    job_id=1,
    override_batch_size=1,
    num_fewshot_seeds=0,
    max_samples=10,
    use_chat_template=False,
)

pipeline = Pipeline(
    tasks="leaderboard|arc:challenge|0|0",
    pipeline_parameters=pipeline_params,
    evaluation_tracker=evaluation_tracker,
    model=model
)

pipeline.evaluate()

pipeline.show_results()

@clefourrier
Copy link
Member Author

clefourrier commented Nov 12, 2024

Ideally, we would want to migrate a bunch of params from the ModelParams to the PipelineParams:

  • multichoice_continuations_start_space
  • pairwise_tokenization
  • add_special_tokens
  • use_chat_template
  • trust_remote_code
  • batch_size

Would simplify model config code. Wdyt @NathanHB ? (Should probably be another PR)

Copy link
Member

@NathanHB NathanHB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it locally and looks great !!

@clefourrier
Copy link
Member Author

Cool! Waiting for some last feedback from Lewis and will merge afterwards

@clefourrier clefourrier merged commit db609f7 into main Nov 19, 2024
2 checks passed
hynky1999 pushed a commit that referenced this pull request Nov 29, 2024
@clefourrier clefourrier mentioned this pull request Nov 30, 2024
hynky1999 pushed a commit that referenced this pull request May 22, 2025
hynky1999 pushed a commit that referenced this pull request May 22, 2025
NathanHB added a commit that referenced this pull request Sep 19, 2025
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.

2 participants