Downloads · 30 days
30
4% of all-time downloads
iryneko571/mt5-base-translation-ja_zh
mt5-base-translation-ja_zh is a translation model from iryneko571. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as mit.
简单的gpu colab笔记本,可以测试,不需要线下的环境配置和安装 <br 总之换成gpu模式可以用啦,翻译一本小说什么的可读性不高(尴尬)<br https://colab.research.google.com/drive/19rQG4ryrue-0g8KH4ATT0o2-8tHLcIT?usp=sharing
Downloads · 30 days
30
4% of all-time downloads
All-time downloads
783
Public
Parameters
582M
2.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.3 GB · 100%
From the Hugging Face model README
简单的gpu colab笔记本,可以测试,不需要线下的环境配置和安装 <br> 总之换成gpu模式可以用啦,翻译一本小说什么的可读性不高(尴尬)<br> https://colab.research.google.com/drive/19rQG4ryrue-0g8KH4ATT0_o2-8tHLcIT?usp=sharing
this model is finetuned from mt5-base, training methods and datasets refers to larryvrh/mt5-translation-ja_zh
used a trimmed and fused dataset CCMatrix-v1-Ja_Zh 1e-4 for 1 epoch no weight decay,arraived at about 1.5 val loss, pretty decent for this behemoth tokenizer
spent about 26h on a modified 2080ti 22g graphic card, but size-wise this is safe to train on much smaller cards
reason for making this model<br> There are some issues in the original model by larryvrh, which includes:
这个模型由 mt5-translation-ja_zh 启发(其实就是在它上面改的),使用mt5-base,比原模型要小一些
使用了CCMatrix-v1-Ja_Zh, 1e-4学习率, 1 个epoch
大概在自己的2080ti 22g卡上跑了26小时,用高级的小卡会更快
制造这个模型的原因 larryvrh的原模型很不错了,但是有一些小问题
还没稳定调试,慎用
from transformers import pipeline
model_name="iryneko571/mt5-base-translation-ja_zh"
#pipe = pipeline("translation",model=model_name,tokenizer=model_name,repetition_penalty=1.4,batch_size=1,max_length=256)
pipe = pipeline("translation",
model=model_name,
repetition_penalty=1.4,
batch_size=1,
max_length=256
)
def translate_batch(batch, language='<-ja2zh->'): # batch is an array of string
i=0 # quickly format the list
while i<len(batch):
batch[i]=f'{language} {batch[i]}'
i+=1
translated=pipe(batch)
result=[]
i=0
while i<len(translated):
result.append(translated[i]['translation_text'])
i+=1
return result
inputs=[]
print(translate_batch(inputs))
Discord Server:<br> https://discord.gg/JmjPmJjA<br> If you need any help, a test server or just want to chat<br> 如果需要帮助,需要试试最新的版本,或者只是为了看下我是啥,可以进channel看看(这边允许发布这个吗?)<br>