Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fkiliver authored Mar 21, 2024
1 parent c515ecb commit cf8fd32
Showing 1 changed file with 15 additions and 52 deletions.
67 changes: 15 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
# 介绍
这是一个基于XUnity.AutoTranslator和Sakura模型的Unity游戏本地翻译器
建议使用Sakura v0.9b https://huggingface.co/SakuraLLM/Sakura-13B-LNovel-v0.9b-GGUF/tree/main
# 准备
首先参考XUnity.AutoTranslator文档部署XUnity.AutoTranslator:[XUnity.AutoTranslator](https://github.com/bbepis/XUnity.AutoTranslator)
然后参考Sakura模型文档完成本地部署:[Sakura模型本地部署教程](https://github.com/SakuraLLM/Sakura-13B-Galgame/wiki)
# 流程
## 启动sakura服务
确保Sakura服务器成功启动并监听http://127.0.0.1:8080

![image](https://github.com/fkiliver/SakuraTranslator/assets/48873439/a69e74a6-f789-4de2-9ce5-d73209f2843c)

[Releases](https://github.com/fkiliver/SakuraTranslator/releases) 下载SakuraTranslator.dll放置在Translators文件夹内

## 修改配置文件
修改AutoTranslatorConfig.ini

添加配置(仅在`OpenAI`模式下生效)

- `UseDict`默认为空字符串
- `DictMode`默认为`Full`
- `Dict`默认为空字符串
<div align="center">
<h1>
SakuraTranslator
</h1>
</div>

其中

- `UseDict`为false时是老的OpenAI Prompt
- `DictMode``Full`时传递整个字典,为`Partial`或其他时,传递当前翻译句子包含的字典部分
- `Dict`为json编码的字符串,格式同MTool,为`{"k1":"v1","k2":"v2"}`,暂未发现SakuraLLM官方示例中给的字典注释有什么作用

添加并发参数MaxConcurrency,单卡多线程总体翻译速度比单线程高(3090,1线程约50t/s,5线程约5x35t/s)

如果你使用sakurav0.10pre0,你的配置文件应该长这样:
```
[Sakura]
Endpoint=http://127.0.0.1:5000/v1/chat/completions
ApiType=OpenAI
MaxConcurrency=1
UseDict=True
DictMode=Full
Dict={"たちばな":"橘","橘":"橘","あやの":"绫乃","綾乃":"绫乃"}
```

如果你使用sakurav0.9或0.8,你的配置文件应该长这样:
```
[Sakura]
Endpoint=http://127.0.0.1:8080/completion ##这里修改为你的模型server监听的地址
##如果使用kaggle,请在你的链接后面加上/v1/chat/completions,例如:https://114514-1919-810.ngrok-free.app/v1/chat/completions
MaxConcurrency=1
ApiType=Qwen ##OpenAI为kaggle上SakuraAPI,Qwen为本地Sakura 0.9模型,空置则为本地Sakura 0.8模型
```
## 启动游戏
启动游戏后,使用快捷键alt+0打开翻译面板,选择SakuraTranslator
# 介绍
这是一个基于XUnity.AutoTranslator和Sakura模型的Unity游戏本地翻译器,能够提供高质量离线日文翻译
建议使用[Sakura-13B-Galgame翻译模型](https://github.com/SakuraLLM/Sakura-13B-Galgame),当前支持版本为Sakura v0.8/v0.9/v0.10pre0

![image](https://github.com/fkiliver/SakuraTranslator/assets/48873439/17c2c144-dab7-4b23-958f-a0dd8ddd11d4)
## TODO
- [ ] 添加退化检测
- [ ] 添加历史上文
- [ ] 添加对sakura v0.10支持
- [ ] 去除对sakura v0.9/v0.8支持

## 快速开始
### 部署教程:详见[本仓库wiki](https://github.com/fkiliver/SakuraTranslator/wiki)
![image](https://github.com/fkiliver/SakuraTranslator/assets/48873439/ffba161d-8d0c-4a0e-bd15-71ab95db30ef)

0 comments on commit cf8fd32

Please sign in to comment.