Skip to content

Inference provider model config to inherit from ModelConfig base class #678

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

Open
wants to merge 1 commit 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
7 changes: 3 additions & 4 deletions src/lighteval/models/endpoints/inference_providers_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@

import asyncio
import logging
from dataclasses import field
from typing import Any, List, Optional

import yaml
from huggingface_hub import AsyncInferenceClient, ChatCompletionOutput
from pydantic import BaseModel, NonNegativeInt
from pydantic import NonNegativeInt
from tqdm import tqdm
from tqdm.asyncio import tqdm as async_tqdm
from transformers import AutoTokenizer
Expand All @@ -41,6 +40,7 @@
LoglikelihoodResponse,
LoglikelihoodSingleTokenResponse,
)
from lighteval.models.utils import ModelConfig
from lighteval.tasks.requests import (
GreedyUntilRequest,
LoglikelihoodRequest,
Expand All @@ -52,7 +52,7 @@
logger = logging.getLogger(__name__)


class InferenceProvidersModelConfig(BaseModel):
class InferenceProvidersModelConfig(ModelConfig):
"""Configuration for InferenceProvidersClient.
Args:
Expand All @@ -68,7 +68,6 @@ class InferenceProvidersModelConfig(BaseModel):
timeout: int | None = None
proxies: Any | None = None
parallel_calls_count: NonNegativeInt = 10
generation_parameters: GenerationParameters = field(default_factory=GenerationParameters)

@classmethod
def from_path(cls, path):
Expand Down
Loading