-
Notifications
You must be signed in to change notification settings - Fork 403
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
[Update] Update docs #1534
Open
bittersweet1999
wants to merge
21
commits into
open-compass:main
Choose a base branch
from
bittersweet1999:jiaochen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Update] Update docs #1534
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
8bd928e
fix pip version
bittersweet1999 8d2a566
fix pip version
bittersweet1999 003d4f7
Merge branch 'open-compass:main' into main
bittersweet1999 d176d1d
Merge branch 'open-compass:main' into main
bittersweet1999 2541889
Merge branch 'open-compass:main' into main
bittersweet1999 91b36ea
Merge branch 'open-compass:main' into main
bittersweet1999 c73a282
Merge branch 'open-compass:main' into main
bittersweet1999 c4aa782
Merge branch 'open-compass:main' into main
bittersweet1999 59f02ce
Merge branch 'open-compass:main' into main
bittersweet1999 03a253a
Merge branch 'open-compass:main' into main
bittersweet1999 d8dd665
Merge branch 'open-compass:main' into main
bittersweet1999 e4209e0
Merge branch 'open-compass:main' into main
bittersweet1999 6fd9c69
Merge branch 'open-compass:main' into main
bittersweet1999 efac296
Merge branch 'open-compass:main' into main
bittersweet1999 d72ca83
Merge branch 'open-compass:main' into main
bittersweet1999 d66be56
Merge branch 'open-compass:main' into main
bittersweet1999 42404a5
Merge branch 'open-compass:main' into main
bittersweet1999 f3f3b20
Merge branch 'open-compass:main' into main
bittersweet1999 5c5d5c1
Merge branch 'open-compass:main' into main
bittersweet1999 ffeb095
Merge branch 'open-compass:main' into main
bittersweet1999 f91abd9
update readme
bittersweet1999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -193,6 +193,52 @@ After ensuring that OpenCompass is installed correctly according to the above st | |||||
opencompass ./configs/eval_api_demo.py | ||||||
``` | ||||||
|
||||||
- Subjective evaluation | ||||||
|
||||||
When conducting subjective evaluations, in addition to specifying the models and datasets, it is also necessary to specify a robust model as the judgemodel, such as using API models like GPT4 or open-source large models like Qwen-72B-Instruct. | ||||||
Prepare the following Python script for parameter specification, where you should replace models, datasets, and judgemodels according to your own needs: | ||||||
|
||||||
``` | ||||||
from mmengine.config import read_base | ||||||
with read_base(): | ||||||
from opencompass.configs.datasets.subjective.alignbench.alignbench_judgeby_critiquellm import alignbench_datasets | ||||||
from opencompass.configs.datasets.subjective.alpaca_eval.alpacav2_judgeby_gpt4 import alpacav2_datasets | ||||||
from opencompass.configs.models.qwen.lmdeploy_qwen2_7b_instruct import models as lmdeploy_qwen2_7b_instruct | ||||||
from opencompass.configs.models.qwen.lmdeploy_qwen2_72b_instruct import models as lmdeploy_qwen2_72b_instruct | ||||||
|
||||||
from opencompass.partitioners import NaivePartitioner | ||||||
from opencompass.partitioners.sub_naive import SubjectiveNaivePartitioner | ||||||
from opencompass.runners import LocalRunner | ||||||
from opencompass.tasks import OpenICLInferTask | ||||||
from opencompass.tasks.subjective_eval import SubjectiveEvalTask | ||||||
from opencompass.summarizers import SubjectiveSummarizer | ||||||
|
||||||
### Base Configuration | ||||||
models = lmdeploy_qwen2_7b_instruct | ||||||
datasets = [*alignbench_datasets, *alpacav2_datasets] | ||||||
judge_models = lmdeploy_qwen2_72b_instruct | ||||||
work_dir = 'outputs/subjective/' | ||||||
|
||||||
|
||||||
### Advanced Configuration | ||||||
infer = dict( | ||||||
partitioner=dict(type=NaivePartitioner), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
runner=dict(type=LocalRunner, max_num_workers=16, task=dict(type=OpenICLInferTask)), | ||||||
) | ||||||
eval = dict( | ||||||
partitioner=dict(type=SubjectiveNaivePartitioner, models=models, judge_models=judge_models,), | ||||||
runner=dict(type=LocalRunner, max_num_workers=16, task=dict(type=SubjectiveEvalTask)), | ||||||
) | ||||||
summarizer = dict(type=SubjectiveSummarizer, function='subjective') | ||||||
``` | ||||||
|
||||||
After setting your config python file, run it! | ||||||
|
||||||
```bash | ||||||
# Python scripts | ||||||
opencompass ./configs/eval_api_demo.py | ||||||
``` | ||||||
|
||||||
- Accelerated Evaluation | ||||||
|
||||||
Additionally, if you want to use an inference backend other than HuggingFace for accelerated evaluation, such as LMDeploy or vLLM, you can do so with the command below. Please ensure that you have installed the necessary packages for the chosen backend and that your model supports accelerated inference with it. For more information, see the documentation on inference acceleration backends [here](docs/en/advanced_guides/accelerator_intro.md). Below is an example using LMDeploy: | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -189,6 +189,52 @@ humaneval, triviaqa, commonsenseqa, tydiqa, strategyqa, cmmlu, lambada, piqa, ce | |||||
opencompass ./configs/eval_api_demo.py | ||||||
``` | ||||||
|
||||||
- ### 主观评测 | ||||||
|
||||||
进行主观评测时,除了需要指定models和datasets,还需要指定一个强有力的模型作为judgemodel,比如使用API模型如GPT4或开源大模型Qwen-72B-Instruct | ||||||
准备如下python脚本进行参数指定,其中的models,datasets和judgemodels根据自己的需求进行替换: | ||||||
|
||||||
``` | ||||||
from mmengine.config import read_base | ||||||
with read_base(): | ||||||
from opencompass.configs.datasets.subjective.alignbench.alignbench_judgeby_critiquellm import alignbench_datasets | ||||||
from opencompass.configs.datasets.subjective.alpaca_eval.alpacav2_judgeby_gpt4 import alpacav2_datasets | ||||||
from opencompass.configs.models.qwen.lmdeploy_qwen2_7b_instruct import models as lmdeploy_qwen2_7b_instruct | ||||||
from opencompass.configs.models.qwen.lmdeploy_qwen2_72b_instruct import models as lmdeploy_qwen2_72b_instruct | ||||||
|
||||||
from opencompass.partitioners import NaivePartitioner | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
from opencompass.partitioners.sub_naive import SubjectiveNaivePartitioner | ||||||
from opencompass.runners import LocalRunner | ||||||
from opencompass.tasks import OpenICLInferTask | ||||||
from opencompass.tasks.subjective_eval import SubjectiveEvalTask | ||||||
from opencompass.summarizers import SubjectiveSummarizer | ||||||
|
||||||
### 基础设定 | ||||||
models = lmdeploy_qwen2_7b_instruct | ||||||
datasets = [*alignbench_datasets, *alpacav2_datasets] | ||||||
judge_models = lmdeploy_qwen2_72b_instruct | ||||||
work_dir = 'outputs/subjective/' | ||||||
|
||||||
|
||||||
### 进阶设定(一般情况下默认即可) | ||||||
infer = dict( | ||||||
partitioner=dict(type=NaivePartitioner), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
runner=dict(type=LocalRunner, max_num_workers=16, task=dict(type=OpenICLInferTask)), | ||||||
) | ||||||
eval = dict( | ||||||
partitioner=dict(type=SubjectiveNaivePartitioner, models=models, judge_models=judge_models,), | ||||||
runner=dict(type=LocalRunner, max_num_workers=16, task=dict(type=SubjectiveEvalTask)), | ||||||
) | ||||||
summarizer = dict(type=SubjectiveSummarizer, function='subjective') | ||||||
``` | ||||||
|
||||||
随后运行 | ||||||
|
||||||
```bash | ||||||
# Python scripts | ||||||
opencompass your_config_name.py | ||||||
``` | ||||||
|
||||||
- ### 推理后端 | ||||||
|
||||||
另外,如果您想使用除 HuggingFace 之外的推理后端来进行加速评估,比如 LMDeploy 或 vLLM,可以通过以下命令进行。请确保您已经为所选的后端安装了必要的软件包,并且您的模型支持该后端的加速推理。更多信息,请参阅关于推理加速后端的文档 [这里](docs/zh_cn/advanced_guides/accelerator_intro.md)。以下是使用 LMDeploy 的示例: | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.