Skip to content

Commit

Permalink
Merge branch 'main' into resize
Browse files Browse the repository at this point in the history
  • Loading branch information
clefourrier authored Sep 16, 2024
2 parents 9296b50 + 7295c78 commit 8a8642c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ lighteval accelerate \
An alternative to launching the evaluation locally is to serve the model on a TGI-compatible server/container and then run the evaluation by sending requests to the server. The command is the same as before, except you specify a path to a yaml config file (detailed below):

```shell
python run_evals_accelerate.py \
lighteval accelerate \
--model_config_path="/path/to/config/file"\
--tasks <task parameters> \
--output_dir output_dir
Expand Down Expand Up @@ -252,17 +252,17 @@ For example, to launch `lighteval` on `arabic_mmlu:abstract_algebra` for `Huggin

```shell
lighteval accelerate \
--model_args "pretrained=HuggingFaceH4/zephyr-7b-beta" \
--model_args "pretrained=HuggingFaceH4/zephyr-7b-beta,trust_remote_code=True" \
--use_chat_template \ # optional, if you want to run the evaluation with the chat template
--tasks "community|arabic_mmlu:abstract_algebra|5|1" \
--custom_tasks "community_tasks/arabic_evals" \
--custom_tasks "community_tasks/arabic_evals.py" \
--output_dir "./evals"
```

### Using the dummy model
To debug or obtain random baseline scores for a given set of tasks, you can use the `dummy` model:
```shell
python run_evals_accelerate.py \
lighteval accelerate \
--model_args "dummy"\
--tasks <task parameters> \
--output_dir output_dir
Expand All @@ -279,7 +279,7 @@ However, we are very grateful to the Harness and HELM teams for their continued

## How to navigate this project
`lighteval` is supposed to be used as a standalone evaluation library.
- To run the evaluations, you can use `run_evals_accelerate.py` or `run_evals_nanotron.py`.
- To run the evaluations, you can use `lighteval accelerate` or `lighteval nanotron`.
- [src/lighteval](https://github.com/huggingface/lighteval/tree/main/src/lighteval) contains the core of the lib itself
- [lighteval](https://github.com/huggingface/lighteval/tree/main/src/lighteval) contains the core of the library, divided in the following section
- [main_accelerate.py](https://github.com/huggingface/lighteval/blob/main/src/lighteval/main_accelerate.py) and [main_nanotron.py](https://github.com/huggingface/lighteval/blob/main/src/lighteval/main_nanotron.py) are our entry points to run evaluation
Expand Down Expand Up @@ -516,4 +516,4 @@ python3 -m build .
version = {0.3.0},
url = {https://github.com/huggingface/lighteval}
}
```
```
2 changes: 1 addition & 1 deletion tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@pytest.fixture
def testing_empty_hf_org_id(org_id: str = TESTING_EMPTY_HF_ORG_ID):
old_token = os.getenv("HF_TOKEN")
os.environ["HF_TOKEN"] = os.getenv("HF_TEST_TOKEN")
os.environ["HF_TOKEN"] = os.getenv("HF_TEST_TOKEN") or ""

def list_repos(org_id: str):
return list(hf_api.list_models(author=org_id)) + list(hf_api.list_datasets(author=org_id))
Expand Down
4 changes: 4 additions & 0 deletions tests/logging/test_evaluation_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ def test_no_details_output(mock_evaluation_tracker: EvaluationTracker):
assert not details_dir.exists()


@pytest.mark.skipif(
reason="Secrets are not available in this environment",
condition=os.getenv("HF_TEST_TOKEN") is None,
)
@pytest.mark.evaluation_tracker(push_to_hub=True, hub_results_org=TESTING_EMPTY_HF_ORG_ID)
def test_push_to_hub_works(testing_empty_hf_org_id, mock_evaluation_tracker: EvaluationTracker, mock_datetime):
# Prepare the dummy data
Expand Down

0 comments on commit 8a8642c

Please sign in to comment.