Skip to content

Commit

Permalink
sperate main.py to lm_eval and bigcode_eval
Browse files Browse the repository at this point in the history
Signed-off-by: changwangss <[email protected]>
  • Loading branch information
changwangss committed May 11, 2024
1 parent c033459 commit f0fe6eb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
27 changes: 27 additions & 0 deletions GenAIEval/evaluation/bigcode_evaluation_harness/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from GenAIEval.evaluation.bigcode_evaluation_harness import evaluate, setup_parser


def main():
eval_args = setup_parser()
results = evaluate(eval_args)
print(results)


if __name__ == "__main__":
main()
2 changes: 0 additions & 2 deletions main.py → .../evaluation/lm_evaluation_harness/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# limitations under the License.
from GenAIEval.evaluation.lm_evaluation_harness import evaluate, setup_parser

# from GenAIEval.evaluation.bigcode_evaluation_harness import evaluate, setup_parser


def main():
eval_args = setup_parser()
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For evaluating the models on text-generation tasks, we follow the [lm-evaluation
```shell

# pip install --upgrade-strategy eager optimum[habana]

cd GenAIEval/evaluation/lm_evaluation_harness
python main.py \
--model gaudi-hf \
--model_args pretrained=EleutherAI/gpt-j-6B \
Expand All @@ -28,6 +28,8 @@ python main.py \

##### CPU
```shell

cd GenAIEval/evaluation/lm_evaluation_harness
python main.py \
--model hf \
--model_args pretrained=EleutherAI/gpt-j-6B \
Expand All @@ -53,12 +55,9 @@ results = evaluate(args)
### bigcode-evaluation-harness
For evaluating the models on coding tasks or specifically coding LLMs, we follow the [bigcode-evaluation-harness](https://github.com/bigcode-project/bigcode-evaluation-harness) and provide the command line usage and function call usage. [HumanEval](https://huggingface.co/datasets/openai_humaneval), [HumanEval+](https://huggingface.co/datasets/evalplus/humanevalplus), [InstructHumanEval](https://huggingface.co/datasets/codeparrot/instructhumaneval), [APPS](https://huggingface.co/datasets/codeparrot/apps), [MBPP](https://huggingface.co/datasets/mbpp), [MBPP+](https://huggingface.co/datasets/evalplus/mbppplus), and [DS-1000](https://github.com/HKUNLP/DS-1000/) for both completion (left-to-right) and insertion (FIM) mode are available.
#### command line usage
There is a small code change in `main.py` regarding the import path.
```diff
- from GenAIEval.evaluation.lm_evaluation_harness import evaluate, setup_parser
+ from GenAIEval.evaluation.bigcode_evaluation_harness import evaluate, setup_parser
```

```shell
cd GenAIEval/evaluation/bigcode_evaluation_harness
python main.py \
--model "codeparrot/codeparrot-small" \
--tasks "humaneval" \
Expand Down

0 comments on commit f0fe6eb

Please sign in to comment.