387 lines
20 KiB
Markdown
387 lines
20 KiB
Markdown
<!-- WEHUB_ZH_README -->
|
||
> [!NOTE]
|
||
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
|
||
> [English](./README.en.md) · [原始项目](https://github.com/lm-sys/FastChat) · [上游 README](https://github.com/lm-sys/FastChat/blob/HEAD/README.md)
|
||
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
|
||
|
||
# FastChat
|
||
| [**Demo**](https://lmarena.ai/) | [**Discord**](https://discord.gg/6GXcFg3TH8) | [**X**](https://x.com/lmsysorg) |
|
||
|
||
FastChat 是一个用于训练、部署和评估基于大语言模型(LLM)的聊天机器人的开放平台。
|
||
- FastChat 为 Chatbot Arena([lmarena.ai](https://lmarena.ai)), 提供支持,已为 70 多款 LLM 处理超过 1000 万次聊天请求。
|
||
- Chatbot Arena 已通过并排 LLM 对战收集了超过 150 万条人工投票,并据此编制了在线 [LLM Elo 排行榜](https://lmarena.ai/?leaderboard).
|
||
|
||
FastChat 的核心功能包括:
|
||
- 最先进模型(例如 Vicuna、MT-Bench)的训练与评估代码。
|
||
- 带 Web UI 且兼容 OpenAI 的 RESTful API 的分布式多模型服务系统。
|
||
|
||
## News
|
||
- [2024/03] 🔥 我们发布了 Chatbot Arena 技术[报告](https://arxiv.org/abs/2403.04132).
|
||
- [2023/09] 我们发布了 **LMSYS-Chat-1M**,一个大规模真实世界 LLM 对话数据集。阅读[报告](https://arxiv.org/abs/2309.11998).
|
||
- [2023/08] 我们基于 Llama 2 发布了 **Vicuna v1.5**,支持 4K 和 16K 上下文长度。下载[权重](#vicuna-weights)。
|
||
- [2023/07] 我们发布了 **Chatbot Arena Conversations**,一个包含 3.3 万条带有人类偏好标注的对话数据集。在[此处](https://huggingface.co/datasets/lmsys/chatbot_arena_conversations). 下载。
|
||
|
||
<details>
|
||
<summary>更多</summary>
|
||
|
||
- [2023/08] 我们基于 Llama 2 发布了 **LongChat v1.5**,支持 32K 上下文长度。下载[权重](#longchat)。
|
||
- [2023/06] 我们推出了 **MT-bench**,一套用于评估聊天机器人的挑战性多轮问答集。查看博客[文章](https://lmsys.org/blog/2023-06-22-leaderboard/).
|
||
- [2023/06] 我们推出了 **LongChat**,即我们的长上下文聊天机器人及评估工具。查看博客[文章](https://lmsys.org/blog/2023-06-29-longchat/).
|
||
- [2023/05] 我们推出了 **Chatbot Arena**,用于 LLM 之间的对战。查看博客[文章](https://lmsys.org/blog/2023-05-03-arena).
|
||
- [2023/03] 我们发布了 **Vicuna: An Open-Source Chatbot Impressing GPT-4 with 90% ChatGPT Quality**。查看博客[文章](https://vicuna.lmsys.org).
|
||
|
||
</details>
|
||
|
||
<a href="https://lmarena.ai"><img src="assets/demo_narrow.gif" width="70%"></a>
|
||
|
||
## Contents
|
||
- [安装](#install)
|
||
- [模型权重](#model-weights)
|
||
- [使用命令行界面进行推理](#inference-with-command-line-interface)
|
||
- [使用 Web GUI 部署服务](#serving-with-web-gui)
|
||
- [API](#api)
|
||
- [评估](#evaluation)
|
||
- [微调](#fine-tuning)
|
||
- [引用](#citation)
|
||
|
||
## 安装
|
||
|
||
### 方法 1:使用 pip
|
||
|
||
```bash
|
||
pip3 install "fschat[model_worker,webui]"
|
||
```
|
||
|
||
### 方法 2:从源码安装
|
||
|
||
1. 克隆本仓库并进入 FastChat 文件夹
|
||
```bash
|
||
git clone https://github.com/lm-sys/FastChat.git
|
||
cd FastChat
|
||
```
|
||
|
||
如果你在 Mac 上运行:
|
||
```bash
|
||
brew install rust cmake
|
||
```
|
||
|
||
2. 安装软件包
|
||
```bash
|
||
pip3 install --upgrade pip # enable PEP 660 support
|
||
pip3 install -e ".[model_worker,webui]"
|
||
```
|
||
|
||
## 模型权重
|
||
### Vicuna 权重
|
||
[Vicuna](https://lmsys.org/blog/2023-03-30-vicuna/) 基于 Llama 2,使用时应遵守 Llama 的[模型许可证](https://github.com/facebookresearch/llama/blob/main/LICENSE).
|
||
|
||
你可以使用下面的命令开始聊天。权重将自动从 Hugging Face 仓库下载。
|
||
下载的权重保存在用户主目录下的 `.cache` 文件夹中(例如 `~/.cache/huggingface/hub/<model_name>`)。
|
||
|
||
有关更多命令选项以及如何处理内存不足问题,请参阅下文「使用命令行界面进行推理」一节。
|
||
|
||
**注意:16K 版本需要 `transformers>=4.31`。**
|
||
|
||
| 规模 | 聊天命令 | Hugging Face 仓库 |
|
||
| --- | --- | --- |
|
||
| 7B | `python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.5` | [lmsys/vicuna-7b-v1.5](https://huggingface.co/lmsys/vicuna-7b-v1.5) |
|
||
| 7B-16k | `python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.5-16k` | [lmsys/vicuna-7b-v1.5-16k](https://huggingface.co/lmsys/vicuna-7b-v1.5-16k) |
|
||
| 13B | `python3 -m fastchat.serve.cli --model-path lmsys/vicuna-13b-v1.5` | [lmsys/vicuna-13b-v1.5](https://huggingface.co/lmsys/vicuna-13b-v1.5) |
|
||
| 13B-16k | `python3 -m fastchat.serve.cli --model-path lmsys/vicuna-13b-v1.5-16k` | [lmsys/vicuna-13b-v1.5-16k](https://huggingface.co/lmsys/vicuna-13b-v1.5-16k) |
|
||
| 33B | `python3 -m fastchat.serve.cli --model-path lmsys/vicuna-33b-v1.3` | [lmsys/vicuna-33b-v1.3](https://huggingface.co/lmsys/vicuna-33b-v1.3) |
|
||
|
||
**旧版权重**:有关所有权重的版本及其差异,请参阅 [docs/vicuna_weights_version.md](docs/vicuna_weights_version.md)。
|
||
|
||
### 其他模型
|
||
除 Vicuna 外,我们还发布了另外两款模型:[LongChat](https://lmsys.org/blog/2023-06-29-longchat/) 和 FastChat-T5。
|
||
你可以使用下面的命令与它们聊天。权重将自动从 Hugging Face 仓库下载。
|
||
|
||
| 模型 | 聊天命令 | Hugging Face 仓库 |
|
||
| --- | --- | --- |
|
||
| LongChat-7B | `python3 -m fastchat.serve.cli --model-path lmsys/longchat-7b-32k-v1.5` | [lmsys/longchat-7b-32k](https://huggingface.co/lmsys/longchat-7b-32k-v1.5) |
|
||
| FastChat-T5-3B | `python3 -m fastchat.serve.cli --model-path lmsys/fastchat-t5-3b-v1.0` | [lmsys/fastchat-t5-3b-v1.0](https://huggingface.co/lmsys/fastchat-t5-3b-v1.0) |
|
||
|
||
## 使用命令行界面进行推理
|
||
|
||
<a href="https://lmarena.ai"><img src="assets/screenshot_cli.png" width="70%"></a>
|
||
|
||
(实验性功能:你可以指定 `--style rich` 以启用富文本输出,并改善部分非 ASCII 内容的文本流式输出质量。某些终端上可能无法正常工作。)
|
||
|
||
#### 支持的模型
|
||
FastChat 支持多种模型,包括
|
||
LLama 2、Vicuna、Alpaca、Baize、ChatGLM、Dolly、Falcon、FastChat-T5、GPT4ALL、Guanaco、MTP、OpenAssistant、OpenChat、RedPajama、StableLM、WizardLM、xDAN-AI 等。
|
||
|
||
完整支持的模型列表及添加新模型的说明请见[此处](docs/model_support.md)。
|
||
|
||
#### 单 GPU
|
||
下面的命令大约需要 14GB GPU 显存(Vicuna-7B)和 28GB GPU 显存(Vicuna-13B)。
|
||
如果显存不足,请参阅下文[「内存不足」](#not-enough-memory)一节。
|
||
`--model-path` 可以是本地文件夹或 Hugging Face 仓库名称。
|
||
```
|
||
python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.5
|
||
```
|
||
|
||
#### 多 GPU
|
||
你可以使用模型并行,聚合同一台机器上多块 GPU 的显存。
|
||
```
|
||
python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.5 --num-gpus 2
|
||
```
|
||
|
||
提示:
|
||
有时 huggingface/transformers 中的「auto」设备映射策略无法在多块 GPU 之间完美平衡内存分配。
|
||
你可以使用 `--max-gpu-memory` 指定每块 GPU 用于存储模型权重的最大内存。
|
||
这样可为激活值分配更多内存,从而使用更长的上下文长度或更大的批大小。例如,
|
||
|
||
```
|
||
python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.5 --num-gpus 2 --max-gpu-memory 8GiB
|
||
```
|
||
|
||
#### 仅 CPU
|
||
这仅在 CPU 上运行,不需要 GPU。Vicuna-7B 大约需要 30GB CPU 内存,Vicuna-13B 大约需要 60GB CPU 内存。
|
||
```
|
||
python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.5 --device cpu
|
||
```
|
||
|
||
使用 Intel AI Accelerator AVX512_BF16/AMX 加速 CPU 推理。
|
||
```
|
||
CPU_ISA=amx python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.5 --device cpu
|
||
```
|
||
|
||
#### Metal 后端(搭载 Apple Silicon 或 AMD GPU 的 Mac 电脑)
|
||
使用 `--device mps` 在 Mac 电脑上启用 GPU 加速(需要 torch >= 2.0)。
|
||
使用 `--load-8bit` 开启 8 位压缩。
|
||
```
|
||
python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.5 --device mps --load-8bit
|
||
```
|
||
Vicuna-7B 可在 32GB 内存的 M1 Macbook 上运行,速度约为每秒 1–2 个词。
|
||
|
||
#### Intel XPU(Intel 数据中心 GPU 与 Arc A 系列 GPU)
|
||
安装 [Intel Extension for PyTorch](https://intel.github.io/intel-extension-for-pytorch/xpu/latest/tutorials/installation.html). 并设置 OneAPI 环境变量:
|
||
```
|
||
source /opt/intel/oneapi/setvars.sh
|
||
```
|
||
|
||
使用 `--device xpu` 启用 XPU/GPU 加速。
|
||
```
|
||
python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.5 --device xpu
|
||
```
|
||
Vicuna-7B 可在 Intel Arc A770 16GB 上运行。
|
||
|
||
#### Ascend NPU
|
||
安装 [Ascend PyTorch Adapter](https://github.com/Ascend/pytorch). 并设置 CANN 环境变量:
|
||
```
|
||
source /usr/local/Ascend/ascend-toolkit/set_env.sh
|
||
```
|
||
|
||
使用 `--device npu` 启用 NPU 加速。
|
||
```
|
||
python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.5 --device npu
|
||
```
|
||
Vicuna-7B/13B 可在 Ascend NPU 上运行。
|
||
|
||
#### 内存不足
|
||
如果内存不足,你可以在上述命令中添加 `--load-8bit` 以启用 8 位压缩。
|
||
这可将内存占用减少约一半,但模型质量会略有下降。
|
||
它兼容 CPU、GPU 和 Metal 后端。
|
||
|
||
启用 8 位压缩后,Vicuna-13B 可在单块 16 GB 显存的 GPU 上运行,例如 Nvidia RTX 3090、RTX 4080、T4、V100(16GB)或 AMD RX 6800 XT。
|
||
|
||
```
|
||
python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.5 --load-8bit
|
||
```
|
||
|
||
此外,你还可以在上述命令中添加 `--cpu-offloading`,将无法放入 GPU 显存的权重卸载到 CPU 内存。
|
||
这需要启用 8 位压缩并安装 bitsandbytes 包,该包仅在 Linux 操作系统上可用。
|
||
|
||
#### 更多平台与量化
|
||
- 对于 AMD GPU 用户,请在安装 FastChat 之前安装 ROCm 和 [ROCm 版 PyTorch](https://pytorch.org/get-started/locally/)。另请参阅这篇[帖子](https://github.com/lm-sys/FastChat/issues/104#issuecomment-1613791563).
|
||
- FastChat 支持 ExLlama V2。请参阅 [docs/exllama_v2.md](/docs/exllama_v2.md)。
|
||
- FastChat 支持通过 [GPTQ-for-LLaMa](https://github.com/qwopqwop200/GPTQ-for-LLaMa). 进行 GPTQ 4 位推理。请参阅 [docs/gptq.md](/docs/gptq.md)。
|
||
- FastChat 支持通过 [mit-han-lab/llm-awq](https://github.com/mit-han-lab/llm-awq). 进行 AWQ 4 位推理。请参阅 [docs/awq.md](/docs/awq.md)。
|
||
- 由 [TVM Unity](https://github.com/apache/tvm/tree/unity) 编译器支持的 [MLC LLM](https://mlc.ai/mlc-llm/), 可通过 Vulkan、Metal、CUDA 和 WebGPU 在手机、消费级 GPU 和 Web 浏览器上原生部署 Vicuna。
|
||
|
||
#### 使用 ModelScope 模型
|
||
中国用户可通过设置以下环境变量,使用来自 www.modelscope.cn 的模型。
|
||
```bash
|
||
export FASTCHAT_USE_MODELSCOPE=True
|
||
```
|
||
|
||
## 使用 Web GUI 提供服务
|
||
|
||
<a href="https://lmarena.ai"><img src="assets/screenshot_gui.png" width="70%"></a>
|
||
|
||
要通过 Web UI 提供服务,你需要三个主要组件:与用户交互的 Web 服务器、托管一个或多个模型的模型 worker,以及用于协调 Web 服务器和模型 worker 的控制器。你可以在[此处](docs/server_arch.md)了解更多架构信息。
|
||
|
||
请在终端中执行以下命令:
|
||
|
||
#### 启动控制器
|
||
```bash
|
||
python3 -m fastchat.serve.controller
|
||
```
|
||
|
||
该控制器负责管理分布式 worker。
|
||
|
||
#### 启动模型 worker
|
||
```bash
|
||
python3 -m fastchat.serve.model_worker --model-path lmsys/vicuna-7b-v1.5
|
||
```
|
||
等待进程完成模型加载,并看到 "Uvicorn running on ..."。模型 worker 会自动向控制器注册。
|
||
|
||
为确保模型 worker 已正确连接到控制器,请使用以下命令发送测试消息:
|
||
```bash
|
||
python3 -m fastchat.serve.test_message --model-name vicuna-7b-v1.5
|
||
```
|
||
你将看到简短输出。
|
||
|
||
#### 启动 Gradio Web 服务器
|
||
```bash
|
||
python3 -m fastchat.serve.gradio_web_server
|
||
```
|
||
|
||
这是用户将与之交互的界面。
|
||
|
||
按照这些步骤,你就可以通过 Web UI 提供模型服务。你现在可以打开浏览器与模型对话。
|
||
如果模型未显示,请尝试重启 gradio web 服务器。
|
||
|
||
## 启动 Chatbot Arena(并排对战 UI)
|
||
|
||
目前,Chatbot Arena 由 FastChat 驱动。以下介绍如何在本地启动 Chatbot Arena 实例。
|
||
|
||
FastChat 支持 OpenAI、Anthropic、Gemini、Mistral 等主流基于 API 的模型。要添加自定义 API,请参阅模型支持[文档](./docs/model_support.md)。以下以 OpenAI 模型为例。
|
||
|
||
创建 JSON 配置文件 `api_endpoint.json`,填写你想提供的模型的 API 端点,例如:
|
||
```
|
||
{
|
||
"gpt-4o-2024-05-13": {
|
||
"model_name": "gpt-4o-2024-05-13",
|
||
"api_base": "https://api.openai.com/v1",
|
||
"api_type": "openai",
|
||
"api_key": [Insert API Key],
|
||
"anony_only": false
|
||
}
|
||
}
|
||
```
|
||
对于 Anthropic 模型,请使用你的 Anthropic 密钥指定 `"api_type": "anthropic_message"`。同样地,对于 Gemini 模型,请指定 `"api_type": "gemini"`。更多细节请参阅 [api_provider.py](https://github.com/lm-sys/FastChat/blob/main/fastchat/serve/api_provider.py).
|
||
|
||
要使用本地 GPU 提供你自己的模型服务,请遵循[使用 Web GUI 提供服务](#serving-with-web-gui)中的说明。
|
||
|
||
现在你可以启动服务器了:
|
||
```
|
||
python3 -m fastchat.serve.gradio_web_server_multi --register-api-endpoint-file api_endpoint.json
|
||
```
|
||
|
||
#### (可选)高级功能、可扩展性与第三方 UI
|
||
- 你可以将多个模型 worker 注册到单个控制器,用于以更高吞吐量提供单个模型服务,或同时提供多个模型。这样做时,请为不同的模型 worker 分配不同的 GPU 和端口。
|
||
```
|
||
# worker 0
|
||
CUDA_VISIBLE_DEVICES=0 python3 -m fastchat.serve.model_worker --model-path lmsys/vicuna-7b-v1.5 --controller http://localhost:21001 --port 31000 --worker http://localhost:31000
|
||
# worker 1
|
||
CUDA_VISIBLE_DEVICES=1 python3 -m fastchat.serve.model_worker --model-path lmsys/fastchat-t5-3b-v1.0 --controller http://localhost:21001 --port 31001 --worker http://localhost:31001
|
||
```
|
||
- 你也可以启动包含 Chatbot Arena 标签页的多标签 Gradio 服务器。
|
||
```bash
|
||
python3 -m fastchat.serve.gradio_web_server_multi
|
||
```
|
||
- 基于 huggingface/transformers 的默认模型 worker 兼容性很好,但可能较慢。如果你需要高吞吐量的批处理服务,可以尝试 [vLLM integration](docs/vllm_integration.md)。
|
||
- 如果你想在自己的 UI 或第三方 UI 上托管,请参阅 [Third Party UI](docs/third_party_ui.md)。
|
||
|
||
## API
|
||
### 兼容 OpenAI 的 RESTful API 与 SDK
|
||
FastChat 为其支持的模型提供兼容 OpenAI 的 API,因此你可以将 FastChat 用作 OpenAI API 的本地替代方案。
|
||
FastChat 服务器同时兼容 [openai-python](https://github.com/openai/openai-python) 库和 cURL 命令。
|
||
REST API 可在 Google Colab 免费版中运行,如仓库中的 [FastChat_API_GoogleColab.ipynb](https://github.com/lm-sys/FastChat/blob/main/playground/FastChat_API_GoogleColab.ipynb) 笔记本所示。
|
||
请参阅 [docs/openai_api.md](docs/openai_api.md)。
|
||
|
||
### Hugging Face 生成 API
|
||
请参阅 [fastchat/serve/huggingface_api.py](fastchat/serve/huggingface_api.py)。
|
||
|
||
### LangChain 集成
|
||
请参阅 [docs/langchain_integration](docs/langchain_integration.md)。
|
||
|
||
## 评估
|
||
我们使用 MT-bench,这是一组具有挑战性的多轮开放式问题,用于评估模型。
|
||
为自动化评估流程,我们提示 GPT-4 等强大的 LLM 担任评委,评估模型回答的质量。
|
||
有关运行 MT-bench 的说明,请参阅 [fastchat/llm_judge](fastchat/llm_judge)。
|
||
|
||
MT-bench 是评测模型的新推荐方式。如果你仍在寻找 vicuna 博客文章中使用的旧版 80 个问题,请前往 [vicuna-blog-eval](https://github.com/lm-sys/vicuna-blog-eval).
|
||
|
||
## 微调
|
||
### 数据
|
||
|
||
Vicuna 通过对 Llama 基础模型进行微调创建,使用了从 ShareGPT.com 通过公开 API 收集的约 125K 条用户共享对话。为确保数据质量,我们将 HTML 转换回 markdown,并过滤掉部分不当或低质量样本。此外,我们将冗长对话拆分为符合模型最大上下文长度的小段。有关清洗 ShareGPT 数据的详细说明,请查看[此处](docs/commands/data_cleaning.md)。
|
||
|
||
我们不会发布 ShareGPT 数据集。如果你想试用微调代码,可以使用 [dummy_conversation.json](data/dummy_conversation.json) 中的一些虚拟对话来运行。你可以遵循相同格式并填入自己的数据。
|
||
|
||
### 代码与超参数
|
||
我们的代码基于 [Stanford Alpaca](https://github.com/tatsu-lab/stanford_alpaca),并额外支持多轮对话(multi-turn conversations)。
|
||
我们使用的超参数与 Stanford Alpaca 类似。
|
||
|
||
| 超参数 | 全局批次大小 | 学习率 | 训练轮数 | 最大长度 | 权重衰减 |
|
||
| --- | ---: | ---: | ---: | ---: | ---: |
|
||
| Vicuna-13B | 128 | 2e-5 | 3 | 2048 | 0 |
|
||
|
||
### 使用本地 GPU 微调 Vicuna-7B
|
||
|
||
- 安装依赖
|
||
```bash
|
||
pip3 install -e ".[train]"
|
||
```
|
||
|
||
- 你可以使用以下命令,在 4 x A100 (40GB) 上训练 Vicuna-7B。请将 `--model_name_or_path` 更新为 Llama 权重的实际路径,并将 `--data_path` 更新为数据的实际路径。
|
||
```bash
|
||
torchrun --nproc_per_node=4 --master_port=20001 fastchat/train/train_mem.py \
|
||
--model_name_or_path meta-llama/Llama-2-7b-hf \
|
||
--data_path data/dummy_conversation.json \
|
||
--bf16 True \
|
||
--output_dir output_vicuna \
|
||
--num_train_epochs 3 \
|
||
--per_device_train_batch_size 2 \
|
||
--per_device_eval_batch_size 2 \
|
||
--gradient_accumulation_steps 16 \
|
||
--evaluation_strategy "no" \
|
||
--save_strategy "steps" \
|
||
--save_steps 1200 \
|
||
--save_total_limit 10 \
|
||
--learning_rate 2e-5 \
|
||
--weight_decay 0. \
|
||
--warmup_ratio 0.03 \
|
||
--lr_scheduler_type "cosine" \
|
||
--logging_steps 1 \
|
||
--fsdp "full_shard auto_wrap" \
|
||
--fsdp_transformer_layer_cls_to_wrap 'LlamaDecoderLayer' \
|
||
--tf32 True \
|
||
--model_max_length 2048 \
|
||
--gradient_checkpointing True \
|
||
--lazy_preprocess True
|
||
```
|
||
|
||
提示:
|
||
- 如果你使用的是不受 FlashAttention 支持的 V100,可以使用 [memory-efficient attention](https://arxiv.org/abs/2112.05682) implemented in [xFormers](https://github.com/facebookresearch/xformers). 安装 xformers,并将上文中的 `fastchat/train/train_mem.py` 替换为 [fastchat/train/train_xformers.py](fastchat/train/train_xformers.py)。
|
||
- 如果因 "FSDP Warning: When using FSDP, it is efficient and recommended... " 而出现显存不足,请参阅[此处](https://github.com/huggingface/transformers/issues/24724#issuecomment-1645189539). 的解决方案。
|
||
- 如果在模型保存过程中遇到显存不足,请参阅[此处](https://github.com/pytorch/pytorch/issues/98823). 的解决方案。
|
||
- 若要开启 Tensorboard、MLFlow 或 Weights & Biases 等常用实验跟踪工具的日志记录,请使用 `report_to` 参数,例如传入 `--report_to wandb` 以开启 Weights & Biases 日志记录。
|
||
|
||
### 其他模型、平台与 LoRA 支持
|
||
关于训练其他模型(例如 FastChat-T5)和使用 LoRA 的更多说明,请参阅 [docs/training.md](docs/training.md)。
|
||
|
||
### 使用 SkyPilot 在任意云上微调
|
||
[SkyPilot](https://github.com/skypilot-org/skypilot) 是由 UC Berkeley 构建的框架,用于在任意云(AWS、GCP、Azure、Lambda 等)上轻松且经济高效地运行机器学习工作负载。
|
||
请在[此处](https://github.com/skypilot-org/skypilot/tree/master/llm/vicuna) 查阅 SkyPilot 文档,了解如何使用 managed spot 实例(managed spot instances)训练 Vicuna 并节省云成本。
|
||
|
||
## 引用
|
||
本仓库中的代码(训练、serving 和评估)大多是为下文论文开发或衍生而来。
|
||
如果你觉得本仓库有帮助,请引用该论文。
|
||
|
||
```
|
||
@misc{zheng2023judging,
|
||
title={Judging LLM-as-a-judge with MT-Bench and Chatbot Arena},
|
||
author={Lianmin Zheng and Wei-Lin Chiang and Ying Sheng and Siyuan Zhuang and Zhanghao Wu and Yonghao Zhuang and Zi Lin and Zhuohan Li and Dacheng Li and Eric. P Xing and Hao Zhang and Joseph E. Gonzalez and Ion Stoica},
|
||
year={2023},
|
||
eprint={2306.05685},
|
||
archivePrefix={arXiv},
|
||
primaryClass={cs.CL}
|
||
}
|
||
```
|
||
|
||
我们也计划将更多研究成果添加到本仓库。
|