-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs]:Add docs about fish agent. (#654)
* [docs]Add docs of Fish Agent. * [docs]:Fix some issues * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [docs]Add Chinese docs for Fish Agent * [docs]fix some issue --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ec2c5b7
commit aaca85b
Showing
10 changed files
with
230 additions
and
66 deletions.
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
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Start Agent | ||
|
||
## Requirements | ||
|
||
- GPU memory: At least 8GB(under quanization), 16GB or more is recommanded. | ||
- Disk usage: 10GB | ||
|
||
## Download Model | ||
|
||
You can get the model by: | ||
|
||
```bash | ||
huggingface-cli download fishaudio/fish-agent-v0.1-3b --local-dir checkpoints/fish-agent-v0.1-3b | ||
``` | ||
|
||
Put them in the 'checkpoints' folder. | ||
|
||
You also need the fish-speech model which you can download instructed by [inference](inference.md). | ||
|
||
So there will be 2 folder in the checkpoints. | ||
|
||
The `checkpoints/fish-speech-1.4` and `checkpoints/fish-agent-v0.1-3b` | ||
|
||
## Environment Prepare | ||
|
||
If you already have Fish-speech, you can directly use by adding the follow instruction: | ||
```bash | ||
pip install cachetools | ||
``` | ||
|
||
!!! note | ||
Please use the Python version below 3.12 for compile. | ||
|
||
If you don't have, please use the below commands to build yout environment: | ||
|
||
```bash | ||
sudo apt-get install portaudio19-dev | ||
|
||
pip install -e .[stable] | ||
``` | ||
|
||
## Launch The Agent Demo. | ||
|
||
To build fish-agent, please use the command below under the main folder: | ||
|
||
```bash | ||
python -m tools.api --llama-checkpoint-path checkpoints/fish-agent-v0.1-3b/ --mode agent --compile | ||
``` | ||
|
||
The `--compile` args only support Python < 3.12 , which will greatly speed up the token generation. | ||
|
||
It won't compile at once (remember). | ||
|
||
Then open another terminal and use the command: | ||
|
||
```bash | ||
python -m tools.e2e_webui | ||
``` | ||
|
||
This will create a Gradio WebUI on the device. | ||
|
||
When you first use the model, it will come to compile (if the `--compile` is True) for a short time, so please wait with patience. | ||
|
||
## Gradio Webui | ||
<p align="center"> | ||
<img src="../assets/figs/agent_gradio.png" width="75%"> | ||
</p> | ||
|
||
Have a good time! | ||
|
||
## Performance | ||
|
||
Under our test, a 4060 laptop just barely runs, but is very stretched, which is only about 8 tokens/s. The 4090 is around 95 tokens/s under compile, which is what we recommend. | ||
|
||
# About Agent | ||
|
||
The demo is an early alpha test version, the inference speed needs to be optimised, and there are a lot of bugs waiting to be fixed. If you've found a bug or want to fix it, we'd be very happy to receive an issue or a pull request. |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Introduction | ||
# 소개 | ||
|
||
<div> | ||
<a target="_blank" href="https://discord.gg/Es5qTB9BcN"> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# 启动 Agent | ||
|
||
## 要求 | ||
|
||
- GPU 显存: 至少 8GB(在量化的条件下),推荐 16GB 及以上 | ||
- 硬盘使用量: 10GB | ||
|
||
## 下载模型 | ||
|
||
你可以执行下面的语句来获取模型: | ||
|
||
```bash | ||
huggingface-cli download fishaudio/fish-agent-v0.1-3b --local-dir checkpoints/fish-agent-v0.1-3b | ||
``` | ||
|
||
如果你处于国内网络,首先执行: | ||
|
||
```bash | ||
export HF_ENDPOINT=https://hf-mirror.com | ||
``` | ||
|
||
把他们放进名为 'checkpoints' 的文件夹内。 | ||
|
||
你同样需要 fish-speech 的模型,关于如何获取 fish-speech 模型请查看[inference](inference.md)。 | ||
|
||
完成后你的 checkpoints 文件夹中会有两个子文件夹:`checkpoints/fish-speech-1.4` 和 `checkpoints/fish-agent-v0.1-3b`。 | ||
|
||
## Environment Prepare | ||
|
||
如果你已经有了 Fish-Speech 环境,你可以在安装下面的包的前提下直接使用: | ||
|
||
```bash | ||
pip install cachetools | ||
``` | ||
|
||
!!! note | ||
请使用小于 3.12 的 python 版本使 compile 可用 | ||
|
||
如果你没有 Fish-Speech 环境,请执行下面的语句来构造你的环境: | ||
|
||
```bash | ||
sudo apt-get install portaudio19-dev | ||
|
||
pip install -e .[stable] | ||
``` | ||
|
||
## 链接 Agent. | ||
|
||
你需要使用以下指令来构建 fish-agent | ||
|
||
```bash | ||
python -m tools.api --llama-checkpoint-path checkpoints/fish-agent-v0.1-3b/ --mode agent --compile | ||
``` | ||
|
||
`--compile`只能在小于 3.12 版本的 Python 使用,这个功能可以极大程度上提高生成速度。 | ||
|
||
你需要哦注意 compile 需要进行一段时间. | ||
|
||
然后启动另一个终端并执行: | ||
|
||
```bash | ||
python -m tools.e2e_webui | ||
``` | ||
|
||
这会在设备上创建一个 Gradio WebUI。 | ||
|
||
每当进行第一轮对话的时候,模型需要 compile 一段时间,请耐心等待 | ||
|
||
## Gradio Webui | ||
|
||
<p align="center"> | ||
<img src="../assets/figs/agent_gradio.png" width="75%"> | ||
</p> | ||
|
||
玩得开心! | ||
|
||
## Performance | ||
|
||
在我们的测试环境下, 4060 laptop GPU 只能刚刚运行该模型,只有大概 8 tokens/s。 4090 CPU 可以在编译后达到 95 tokens/s,我们推荐使用至少 4080 以上级别的 GPU 来达到较好体验。 | ||
|
||
# About Agent | ||
|
||
该模型仍处于测试阶段。如果你发现了问题,请给我们提 issue 或者 pull request,我们非常感谢。 |
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