fishspeech2 / docs /ko /start_agent.md
pineconeT94's picture
first commit
8b14bed
# ์—์ด์ „ํŠธ ์‹œ์ž‘ํ•˜๊ธฐ
!!! note
์ „์ฒด ๋ฌธ์„œ๋Š” claude3.5 Sonnet์— ์˜ํ•ด ๋ฒˆ์—ญ๋˜์—ˆ์œผ๋ฉฐ, ์›์–ด๋ฏผ์ธ ๊ฒฝ์šฐ ๋ฒˆ์—ญ์— ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹ค๊ณ  ์ƒ๊ฐ๋˜๋ฉด ์ด์Šˆ๋‚˜ ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ๋ณด๋‚ด์ฃผ์…”์„œ ๋Œ€๋‹จํžˆ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!
## ์š”๊ตฌ์‚ฌํ•ญ
- GPU ๋ฉ”๋ชจ๋ฆฌ: ์ตœ์†Œ 8GB(์–‘์žํ™” ์‚ฌ์šฉ ์‹œ), 16GB ์ด์ƒ ๊ถŒ์žฅ
- ๋””์Šคํฌ ์‚ฌ์šฉ๋Ÿ‰: 10GB
## ๋ชจ๋ธ ๋‹ค์šด๋กœ๋“œ
๋‹ค์Œ ๋ช…๋ น์–ด๋กœ ๋ชจ๋ธ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:
```bash
huggingface-cli download fishaudio/fish-agent-v0.1-3b --local-dir checkpoints/fish-agent-v0.1-3b
```
'checkpoints' ํด๋”์— ํŒŒ์ผ๋“ค์„ ๋„ฃ์œผ์„ธ์š”.
๋˜ํ•œ [inference](inference.md)์— ์„ค๋ช…๋œ ๋Œ€๋กœ fish-speech ๋ชจ๋ธ๋„ ๋‹ค์šด๋กœ๋“œํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
checkpoints์—๋Š” 2๊ฐœ์˜ ํด๋”๊ฐ€ ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
`checkpoints/fish-speech-1.4`์™€ `checkpoints/fish-agent-v0.1-3b`์ž…๋‹ˆ๋‹ค.
## ํ™˜๊ฒฝ ์ค€๋น„
์ด๋ฏธ Fish-speech๊ฐ€ ์žˆ๋‹ค๋ฉด ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ๋ฐ”๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:
```bash
pip install cachetools
```
!!! ์ฐธ๊ณ 
์ปดํŒŒ์ผ์„ ์œ„ํ•ด Python 3.12 ๋ฏธ๋งŒ ๋ฒ„์ „์„ ์‚ฌ์šฉํ•ด ์ฃผ์„ธ์š”.
์—†๋‹ค๋ฉด ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•˜์„ธ์š”:
```bash
sudo apt-get install portaudio19-dev
pip install -e .[stable]
```
## ์—์ด์ „ํŠธ ๋ฐ๋ชจ ์‹คํ–‰
fish-agent๋ฅผ ๊ตฌ์ถ•ํ•˜๋ ค๋ฉด ๋ฉ”์ธ ํด๋”์—์„œ ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”:
```bash
python -m tools.api --llama-checkpoint-path checkpoints/fish-agent-v0.1-3b/ --mode agent --compile
```
`--compile` ์ธ์ž๋Š” Python < 3.12์—์„œ๋งŒ ์ง€์›๋˜๋ฉฐ, ํ† ํฐ ์ƒ์„ฑ ์†๋„๋ฅผ ํฌ๊ฒŒ ํ–ฅ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค.
ํ•œ ๋ฒˆ์— ์ปดํŒŒ์ผ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค(๊ธฐ์–ตํ•ด ๋‘์„ธ์š”).
๊ทธ๋Ÿฐ ๋‹ค์Œ ๋‹ค๋ฅธ ํ„ฐ๋ฏธ๋„์„ ์—ด๊ณ  ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”:
```bash
python -m tools.e2e_webui
```
์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ๊ธฐ๊ธฐ์— Gradio WebUI๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.
๋ชจ๋ธ์„ ์ฒ˜์Œ ์‚ฌ์šฉํ•  ๋•Œ๋Š” (`--compile`์ด True์ธ ๊ฒฝ์šฐ) ์ž ์‹œ ์ปดํŒŒ์ผ์ด ์ง„ํ–‰๋˜๋ฏ€๋กœ ๊ธฐ๋‹ค๋ ค ์ฃผ์„ธ์š”.
## Gradio Webui
<p align="center">
<img src="../../assets/figs/agent_gradio.png" width="75%">
</p>
์ฆ๊ฑฐ์šด ์‹œ๊ฐ„ ๋˜์„ธ์š”!
## ์„ฑ๋Šฅ
ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ, 4060 ๋…ธํŠธ๋ถ์€ ๊ฒจ์šฐ ์‹คํ–‰๋˜๋ฉฐ ๋งค์šฐ ๋ถ€ํ•˜๊ฐ€ ํฐ ์ƒํƒœ๋กœ, ์ดˆ๋‹น ์•ฝ 8ํ† ํฐ ์ •๋„๋งŒ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. 4090์€ ์ปดํŒŒ์ผ ์ƒํƒœ์—์„œ ์ดˆ๋‹น ์•ฝ 95ํ† ํฐ์„ ์ฒ˜๋ฆฌํ•˜๋ฉฐ, ์ด๊ฒƒ์ด ์ €ํฌ๊ฐ€ ๊ถŒ์žฅํ•˜๋Š” ์‚ฌ์–‘์ž…๋‹ˆ๋‹ค.
# ์—์ด์ „ํŠธ ์†Œ๊ฐœ
์ด ๋ฐ๋ชจ๋Š” ์ดˆ๊ธฐ ์•ŒํŒŒ ํ…Œ์ŠคํŠธ ๋ฒ„์ „์œผ๋กœ, ์ถ”๋ก  ์†๋„ ์ตœ์ ํ™”๊ฐ€ ํ•„์š”ํ•˜๋ฉฐ ์ˆ˜์ •ํ•ด์•ผ ํ•  ๋ฒ„๊ทธ๊ฐ€ ๋งŽ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฒ„๊ทธ๋ฅผ ๋ฐœ๊ฒฌํ•˜๊ฑฐ๋‚˜ ์ˆ˜์ •ํ•˜๊ณ  ์‹ถ์œผ์‹œ๋‹ค๋ฉด ์ด์Šˆ๋‚˜ ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ๋ณด๋‚ด์ฃผ์‹œ๋ฉด ๋งค์šฐ ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.