Lengyue 2 лет назад
Родитель
Сommit
3f7b8215bc
3 измененных файлов с 14 добавлено и 13 удалено
  1. 3 2
      README.md
  2. 7 7
      README.zh.md
  3. 4 4
      tools/llama/generate.py

+ 3 - 2
README.md

@@ -1,6 +1,6 @@
 # Fish Speech
 # Fish Speech
 
 
-**Documentation is under construction**
+**Documentation is under construction, English is not fully supported yet.**
 
 
 [中文文档](README.zh.md)
 [中文文档](README.zh.md)
 
 
@@ -33,7 +33,8 @@ pip3 install -e .
 Download required `vqgan` and `text2semantic` model from our huggingface repo.
 Download required `vqgan` and `text2semantic` model from our huggingface repo.
 
 
 ```bash
 ```bash
-TODO
+wget https://huggingface.co/fishaudio/speech-lm-v1/raw/main/vqgan-v1.pth -O checkpoints/vqgan-v1.pth
+wget https://huggingface.co/fishaudio/speech-lm-v1/blob/main/text2semantic-400m-v0.1-4k.pth -O checkpoints/text2semantic-400m-v0.1-4k.pth
 ```
 ```
 
 
 Generate semantic tokens from text:
 Generate semantic tokens from text:

+ 7 - 7
README.zh.md

@@ -1,7 +1,5 @@
 # Fish Speech
 # Fish Speech
 
 
-**文档正在编写中**
-
 此代码库根据 BSD-3-Clause 许可证发布,所有模型根据 CC-BY-NC-SA-4.0 许可证发布。请参阅 [LICENSE](LICENSE) 了解更多细节。
 此代码库根据 BSD-3-Clause 许可证发布,所有模型根据 CC-BY-NC-SA-4.0 许可证发布。请参阅 [LICENSE](LICENSE) 了解更多细节。
 
 
 ## 免责声明
 ## 免责声明
@@ -32,12 +30,13 @@ pip3 install -e .
 从我们的 huggingface 仓库下载所需的 `vqgan` 和 `text2semantic` 模型。
 从我们的 huggingface 仓库下载所需的 `vqgan` 和 `text2semantic` 模型。
     
     
 ```bash
 ```bash
-TODO
+wget https://huggingface.co/fishaudio/speech-lm-v1/raw/main/vqgan-v1.pth -O checkpoints/vqgan-v1.pth
+wget https://huggingface.co/fishaudio/speech-lm-v1/blob/main/text2semantic-400m-v0.1-4k.pth -O checkpoints/text2semantic-400m-v0.1-4k.pth
 ```
 ```
 
 
 ### [可选] 从语音生成 prompt:
 ### [可选] 从语音生成 prompt:
 ```bash
 ```bash
-python tools/vqgan/inference.py -i codes_0.wav
+python tools/vqgan/inference.py -i paimon.wav --checkpoint-path checkpoints/vqgan-v1.pth
 ```
 ```
 
 
 你应该能得到一个 `fake.npy` 文件。
 你应该能得到一个 `fake.npy` 文件。
@@ -48,16 +47,17 @@ python tools/llama/generate.py \
     --text "要转换的文本" \
     --text "要转换的文本" \
     --prompt-string "你的参考文本" \
     --prompt-string "你的参考文本" \
     --prompt-tokens "fake.npy" \
     --prompt-tokens "fake.npy" \
-    --checkpoint-path results/text2semantic_400m_finetune/step_000002000.pth \
+    --checkpoint-path "checkpoints/text2semantic-400m-v0.1-4k.pth" \
     --num-samples 2 \
     --num-samples 2 \
     --compile
     --compile
 ```
 ```
 
 
-您可能希望使用 `--compile` 来融合 cuda 内核以实现更快的推理(~25 个 token/秒 -> ~300 个 token/秒)。
+该命令会在工作目录下创建 `codes_N` 文件,其中 N 是从 0 开始的整数。
+您可能希望使用 `--compile` 来融合 cuda 内核以实现更快的推理(~30 个 token/秒 -> ~500 个 token/秒)。
 
 
 ### 从语义 token 生成人声:
 ### 从语义 token 生成人声:
 ```bash
 ```bash
-python tools/vqgan/inference.py -i codes_0.npy
+python tools/vqgan/inference.py -i codes_0.npy --checkpoint-path checkpoints/vqgan-v1.pth
 ```
 ```
 
 
 ## Rust 数据服务器
 ## Rust 数据服务器

+ 4 - 4
tools/llama/generate.py

@@ -338,10 +338,10 @@ def load_model(config_name, checkpoint_path, device, precision):
 )
 )
 @click.option("--num-samples", type=int, default=1)
 @click.option("--num-samples", type=int, default=1)
 @click.option("--max_new_tokens", type=int, default=0)
 @click.option("--max_new_tokens", type=int, default=0)
-@click.option("--top_k", type=int, default=50)
-@click.option("--top_p", type=float, default=0.95)
-@click.option("--repetition-penalty", type=float, default=1.05)
-@click.option("--temperature", type=float, default=0.8)
+@click.option("--top-k", type=int, default=None)
+@click.option("--top-p", type=float, default=0.5)
+@click.option("--repetition-penalty", type=float, default=1.1)
+@click.option("--temperature", type=float, default=0.7)
 @click.option(
 @click.option(
     "--checkpoint-path",
     "--checkpoint-path",
     type=click.Path(path_type=Path, exists=True),
     type=click.Path(path_type=Path, exists=True),