Downloads · 30 days
132
15% of all-time downloads
iryneko571/mt5-translation-ja_zh-game-small
mt5-translation-ja_zh-game-small 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.
iryneko571/mt5-small-translation-jazh<br better in most aspects, more like a base model with pure data<br 数值上更好,是用更纯的数据跑的<br includes colab notebook<br 已经配置了colab的notebook,可以直接测试翻译,不需要安装<br
Downloads · 30 days
132
15% of all-time downloads
All-time downloads
888
Public
Parameters
300M
1.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 98%
From the Hugging Face model README
iryneko571/mt5-small-translation-ja_zh<br> better in most aspects, more like a base model with pure data<br> 数值上更好,是用更纯的数据跑的<br> includes colab notebook<br> 已经配置了colab的notebook,可以直接测试翻译,不需要安装<br>
this model is finetuned from mt5-small
will use about 1.5G vram, fp16 will be less than 1G(if batch size is small), cpu inference speed is ok anyway
used a trimmed piece of pontoon dataset that features ja to zh translate part
also scrambled bunch of the translation from mt5-translation-ja_zh-game-v0.1, which is a large amount of junk for training
reason for making this model<br> Testing the ideas of using pontoon dataset<br> Constructing a flexible translation evaluation standard, need a poor performance model to compare
还没稳定调试,慎用
from transformers import pipeline
model_name="iryneko571/mt5-translation-ja_zh-game-small"
#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>