You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/evaluating-a-custom-model.mdx
+47-26Lines changed: 47 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
-
# Evaluating a Custom Model
1
+
# Custom Model
2
2
3
-
Lighteval allows you to evaluate custom model implementations by creating a custom model class that inherits from `LightevalModel`. This is useful when you want to evaluate models that aren't directly supported by the standard backends (transformers, vllm, etc).
3
+
Lighteval allows you to evaluate custom model implementations by creating a custom model class that inherits from `LightevalModel`.
4
+
This is useful when you want to evaluate models that aren't directly supported by the standard backends and providers (transformers, vllm, etc), or
5
+
if you want to add your own pre/post processing.
4
6
5
7
## Creating a Custom Model
6
8
@@ -9,28 +11,34 @@ Lighteval allows you to evaluate custom model implementations by creating a cust
9
11
Here's a basic example:
10
12
11
13
```python
14
+
from typing import List
12
15
from lighteval.models.abstract_model import LightevalModel
16
+
from lighteval.models.model_output import ModelResponse
17
+
from lighteval.tasks.requests import Doc
18
+
from lighteval.utils.cache_management import SampleCache, cached
# Implement single token loglikelihood computation
33
-
pass
34
42
```
35
43
36
44
2. The custom model file should contain exactly one class that inherits from `LightevalModel`. This class will be automatically detected and instantiated when loading the model.
0 commit comments