Update README.md
Browse files
README.md
CHANGED
|
@@ -1,13 +1,83 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 4.41.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
|
|
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: DmxMetric
|
| 3 |
+
emoji: 🌖
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 4.41.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
| 11 |
+
tags:
|
| 12 |
+
- evaluate
|
| 13 |
+
- metric
|
| 14 |
+
description: >-
|
| 15 |
+
Evaluation function using lm-eval with d-Matrix integration.
|
| 16 |
+
This function allows for the evaluation of language models across various tasks,
|
| 17 |
+
with the option to use d-Matrix compressed models. For more information, see
|
| 18 |
+
https://github.com/EleutherAI/lm-evaluation-harness and https://github.com/d-matrix-ai/dmx-compressor
|
| 19 |
---
|
| 20 |
+
# Metric Card for dmxMetric
|
| 21 |
|
| 22 |
+
## How to Use
|
| 23 |
+
|
| 24 |
+
import evaluate
|
| 25 |
+
|
| 26 |
+
metric = evaluate.load("d-matrix/dmxMetric", module_type="metric")
|
| 27 |
+
|
| 28 |
+
results = metric._compute(
|
| 29 |
+
model="d-matrix/gpt2",
|
| 30 |
+
revision = "distilgpt2",
|
| 31 |
+
tasks="wikitext",
|
| 32 |
+
dmx_config = "BASIC"
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
print(results)
|
| 36 |
+
|
| 37 |
+
### Inputs
|
| 38 |
+
- **model** (`str`): The name or path of the model to evaluate.
|
| 39 |
+
- **tasks** (`Union[str, List[str]]`): The task or list of tasks to evaluate on.
|
| 40 |
+
- **dmx_config** (`Optional[str]`): Configuration string for d-Matrix transformations, defaults to None.
|
| 41 |
+
- **num_fewshot** (`Optional[int]`): Number of examples in few-shot context, defaults to None.
|
| 42 |
+
- **batch_size** (`Optional[Union[int, str]]`): Batch size for evaluation, defaults to None.
|
| 43 |
+
- **max_batch_size** (`Optional[int]`): Maximum batch size to try with automatic batch size detection, defaults to None.
|
| 44 |
+
- **limit** (`Optional[Union[int, float]]`): Limit the number of examples per task, defaults to None.
|
| 45 |
+
- **device** (`Optional[str]`): Device to run on, defaults to 'cuda' when available, otherwise 'cpu'.
|
| 46 |
+
- **revision** (`str`): Model revision to use, defaults to 'main'.
|
| 47 |
+
- **trust_remote_code** (`bool`): Whether to trust remote code, defaults to False.
|
| 48 |
+
- **log_samples** (`bool`): If True, logs all model outputs and documents, defaults to True.
|
| 49 |
+
- **verbosity** (`str`): Logging verbosity level, defaults to 'INFO'.
|
| 50 |
+
- **kwargs**: Additional keyword arguments to pass to `lm_eval.evaluate`.
|
| 51 |
+
|
| 52 |
+
### Output Values
|
| 53 |
+
- **results** (`dict`): A dictionary containing the evaluation results for each task.
|
| 54 |
+
|
| 55 |
+
Output Example:
|
| 56 |
+
```python
|
| 57 |
+
{
|
| 58 |
+
'wikitext': {
|
| 59 |
+
'alias': 'wikitext',
|
| 60 |
+
'word_perplexity,none': 56.66175009356436,
|
| 61 |
+
'word_perplexity_stderr,none': 'N/A',
|
| 62 |
+
'byte_perplexity,none': 2.127521665015424,
|
| 63 |
+
'byte_perplexity_stderr,none': 'N/A',
|
| 64 |
+
'bits_per_byte,none': 1.0891738232631387,
|
| 65 |
+
'bits_per_byte_stderr,none': 'N/A'
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
This metric outputs a dictionary containing the evaluation results for each task. In this example, the results are shown for the 'wikitext' task. The output includes various perplexity and bits-per-byte metrics, along with their standard errors (where available). The specific metrics may include:
|
| 71 |
+
|
| 72 |
+
- `alias`: The name or alias of the task.
|
| 73 |
+
- `word_perplexity,none`: The perplexity calculated on a word level.
|
| 74 |
+
- `word_perplexity_stderr,none`: The standard error of the word perplexity (if available).
|
| 75 |
+
- `byte_perplexity,none`: The perplexity calculated on a byte level.
|
| 76 |
+
- `byte_perplexity_stderr,none`: The standard error of the byte perplexity (if available).
|
| 77 |
+
- `bits_per_byte,none`: The average number of bits required to encode each byte of the text.
|
| 78 |
+
- `bits_per_byte_stderr,none`: The standard error of the bits per byte metric (if available).
|
| 79 |
+
|
| 80 |
+
Note that 'N/A' values indicate that the standard error was not calculated or not available for that metric.
|
| 81 |
+
|
| 82 |
+
## Citation(s)
|
| 83 |
+
https://github.com/EleutherAI/lm-evaluation-harness
|