Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunnglin committed Aug 14, 2024
1 parent c828740 commit ef9af7f
Show file tree
Hide file tree
Showing 12 changed files with 115 additions and 28 deletions.
9 changes: 0 additions & 9 deletions docs/zh/README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@
<a href="https://github.com/modelscope/evalscope/pulls"><img src="https://img.shields.io/badge/PR-welcome-55EB99.svg"></a>
<p>

## 📖 目录
- [简介](#简介)
- [新闻](#新闻)
- [环境准备](#环境准备)
- [快速开始](#快速开始)
- [数据集列表](#数据集列表)
- [Leaderboard榜单](#leaderboard-榜单)
- [实验和报告](#实验和报告)
- [性能评测工具](#性能评测工具)


## 📝 简介
Expand Down
1 change: 1 addition & 0 deletions docs/zh/advanced_guides/custom_dataset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 自定义数据集评估
1 change: 1 addition & 0 deletions docs/zh/advanced_guides/custom_model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 自定义模型评估
Empty file.
1 change: 1 addition & 0 deletions docs/zh/best_practice/swift_integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ms-swift 集成
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 快速开始
# 基本使用

## 简单评估
在指定的若干数据集上使用默认配置评估某个模型,流程如下:
Expand Down Expand Up @@ -58,7 +58,8 @@ python evalscope/run.py \
```shell
python evalscope/run.py \
--model qwen/Qwen-1_8B \
--generation-config do_sample=false,temperature=0.0 --datasets ceval \
--generation-config do_sample=false,temperature=0.0 \
--datasets ceval \
--dataset-args '{"ceval": {"few_shot_num": 0, "few_shot_random": false}}' \
--limit 10
```
Expand All @@ -81,7 +82,7 @@ python evalscope/run.py \

## 支持的数据集列表
```{note}
目前框架支持如下数据集,若您需要的数据集不在列表中,请提交issue,或者使用[OpenCompass backend](../advanced_guides/opencompass_backend.md)进行评估;或使用[OpenCompass backend](../advanced_guides/vlmevalkit_backend.md)进行多模态模型评估
目前框架支持如下数据集,若您需要的数据集不在列表中,请提交issue,或者使用[OpenCompass backend](../user_guides/opencompass_backend.md)进行评估;或使用[VLMEvalKit backend](../user_guides/vlmevalkit_backend.md)进行多模态模型评估
```

| DatasetName | Link | Status | Note |
Expand Down
19 changes: 15 additions & 4 deletions docs/zh/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,40 @@ EvalScope 上手路线

get_started/introduction.md
get_started/installation.md
get_started/quick_start.md
get_started/basic_usage.md

.. _教程:
.. toctree::
:maxdepth: 1
:caption: 教程


user_guides/offline_evaluation.md
user_guides/arena.md
user_guides/opencompass_backend.md
user_guides/vlmevalkit_backend.md
user_guides/toolbench.md

.. _进阶教程:
.. toctree::
:maxdepth: 1
:caption: 进阶教程


advanced_guides/custom_dataset.md
advanced_guides/custom_model.md

.. _性能监控:
.. toctree::
:maxdepth: 1
:caption: 性能监控

stress_test/quick_start.md


.. _最佳实践:
.. toctree::
:maxdepth: 1
:caption: 最佳实践

best_practice/swift_integration.md

索引与表格
==================
Expand Down
75 changes: 75 additions & 0 deletions docs/zh/user_guides/arena.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# 竞技场模式
竞技场模式允许多个候选模型通过两两对比(pairwise battle)的方式进行评估,并可以选择借助AI Enhanced Auto-Reviewer(AAR)自动评估流程或者人工评估的方式,最终得到评估报告,流程示例如下:
#### 1. 环境准备
```text
a. 数据准备,questions data格式参考:evalscope/registry/data/question.jsonl
b. 如果需要使用自动评估流程(AAR),则需要配置相关环境变量,我们以GPT-4 based auto-reviewer流程为例,需要配置以下环境变量:
> export OPENAI_API_KEY=YOUR_OPENAI_API_KEY
```

#### 2. 配置文件
```text
arena评估流程的配置文件参考: evalscope/registry/config/cfg_arena.yaml
字段说明:
questions_file: question data的路径
answers_gen: 候选模型预测结果生成,支持多个模型,可通过enable参数控制是否开启该模型
reviews_gen: 评估结果生成,目前默认使用GPT-4作为Auto-reviewer,可通过enable参数控制是否开启该步骤
elo_rating: ELO rating 算法,可通过enable参数控制是否开启该步骤,注意该步骤依赖review_file必须存在
```

#### 3. 执行脚本
```shell
#Usage:
cd evalscope

# dry-run模式 (模型answer正常生成,但专家模型,如GPT-4,不会被调用,评估结果会随机生成)
python evalscope/run_arena.py -c registry/config/cfg_arena.yaml --dry-run

# 执行评估流程
python evalscope/run_arena.py --c registry/config/cfg_arena.yaml
```

#### 4. 结果可视化

```shell
# Usage:
streamlit run viz.py --review-file evalscope/registry/data/qa_browser/battle.jsonl --category-file evalscope/registry/data/qa_browser/category_mapping.yaml
```



### 单模型打分模式(Single mode)

这个模式下,我们只对单个模型输出做打分,不做两两对比。
#### 1. 配置文件
```text
评估流程的配置文件参考: evalscope/registry/config/cfg_single.yaml
字段说明:
questions_file: question data的路径
answers_gen: 候选模型预测结果生成,支持多个模型,可通过enable参数控制是否开启该模型
reviews_gen: 评估结果生成,目前默认使用GPT-4作为Auto-reviewer,可通过enable参数控制是否开启该步骤
rating_gen: rating 算法,可通过enable参数控制是否开启该步骤,注意该步骤依赖review_file必须存在
```
#### 2. 执行脚本
```shell
#Example:
python evalscope/run_arena.py --c registry/config/cfg_single.yaml
```

### Baseline模型对比模式(Pairwise-baseline mode)

这个模式下,我们选定 baseline 模型,其他模型与 baseline 模型做对比评分。这个模式可以方便的把新模型加入到 Leaderboard 中(只需要对新模型跟 baseline 模型跑一遍打分即可)
#### 1. 配置文件
```text
评估流程的配置文件参考: evalscope/registry/config/cfg_pairwise_baseline.yaml
字段说明:
questions_file: question data的路径
answers_gen: 候选模型预测结果生成,支持多个模型,可通过enable参数控制是否开启该模型
reviews_gen: 评估结果生成,目前默认使用GPT-4作为Auto-reviewer,可通过enable参数控制是否开启该步骤
rating_gen: rating 算法,可通过enable参数控制是否开启该步骤,注意该步骤依赖review_file必须存在
```
#### 2. 执行脚本
```shell
# Example:
python evalscope/run_arena.py --c registry/config/cfg_pairwise_baseline.yaml
```
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
# 使用本地数据集

数据集默认托管在[ModelScope](https://modelscope.cn/datasets)上,加载需要联网。如果是无网络环境,可以使用本地数据集,流程如下:
#### 1. 下载数据集到本地

## 1. 下载数据集到本地
假如当前本地工作路径为 `/path/to/workdir`,执行以下命令:
```shell
# 假如当前本地工作路径为 /path/to/workdir
wget https://modelscope.oss-cn-beijing.aliyuncs.com/open_data/benchmark/data.zip
unzip data.zip
```
则解压后的数据集路径为:/path/to/workdir/data 目录下,该目录在后续步骤将会作为--dataset-dir参数的值传入
则解压后的数据集在:`/path/to/workdir/data` 目录下,该目录在后续步骤将会作为`--dataset-dir`参数的值传入

#### 2. 使用本地数据集创建评估任务
## 2. 使用本地数据集创建评估任务
```shell
python evalscope/run.py --model ZhipuAI/chatglm3-6b --template-type chatglm3 --datasets arc --dataset-hub Local --dataset-args '{"arc": {"local_path": "/path/to/workdir/data/arc"}}' --limit 10

# 参数说明
# --dataset-hub: 数据集来源,枚举值: `ModelScope`, `Local`, `HuggingFace` (TO-DO) 默认为`ModelScope`
# --dataset-dir: 当--dataset-hub为`Local`时,该参数指本地数据集路径; 如果--dataset-hub 设置为`ModelScope` or `HuggingFace`,则该参数的含义是数据集缓存路径。
python evalscope/run.py \
--model ZhipuAI/chatglm3-6b \
--template-type chatglm3 \
--datasets arc \
--dataset-hub Local \
--dataset-args '{"arc": {"local_path": "/path/to/workdir/data/arc"}}' \
--limit 10
```
### 参数说明
- `--dataset-hub`: 数据集来源,枚举值: `ModelScope``Local`, 默认为`ModelScope`
- `--dataset-dir`: 当`--dataset-hub``Local`时,该参数指本地数据集路径; 如果`--dataset-hub``ModelScope`,则该参数的含义是数据集缓存路径。

#### 3. 在离线环境加载模型和评测
## 3. 在离线环境加载模型和评测
模型文件托管在ModelScope Hub端,需要联网加载,当需要在离线环境创建评估任务时,可参考以下步骤:
```shell
# 1. 准备模型本地文件夹,文件夹结构参考chatglm3-6b,链接:https://modelscope.cn/models/ZhipuAI/chatglm3-6b/files
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ToolBench

## Description
We evaluate the effectiveness of tool learning benchmark: [ToolBench](https://arxiv.org/pdf/2307.16789) (Qin et al.,2023b). The task involve integrating API calls to accomplish tasks, where the agent must accurately select the appropriate API and compose necessary API requests.
Expand Down Expand Up @@ -95,8 +96,6 @@ refer to [config_default.yaml](config_default.yaml) for more details.
### Run the task
```python
```python
```python
from evalscope.third_party.toolbench_static import run_task

Expand Down
File renamed without changes.

0 comments on commit ef9af7f

Please sign in to comment.