Downloads · 30 days
36
1% of all-time downloads
chi-vi/hirashiba-mt-tiny-zh-vi
hirashiba-mt-tiny-zh-vi is a translation model from chi-vi. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as gpl-3.0.
Downloads · 30 days
36
1% of all-time downloads
All-time downloads
2.6K
Public
Parameters
14.8M
1.4 GB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors59.4 MB · 97%
From the Hugging Face model README
Hira's intelligence, Shiba's speed
Hirashiba-MT-zh-vi is a model used for gatekeeping and refilling water.
from transformers import MarianMTModel, MarianTokenizer
model_name = "chi-vi/hirashiba-mt-tiny-zh-vi"
tokenizer = MarianTokenizer.from_pretrained(model_name)
model = MarianMTModel.from_pretrained(model_name)
def translate(lines):
inputs = tokenizer(lines, return_tensors="pt", padding=True)
translated = model.generate(**inputs)
return [tokenizer.decode(t, skip_special_tokens=True) for t in translated]
with open('sample.txt') as f:
src_text = f.readlines()
import time
start = time.time()
translated = translate(src_text)
end = time.time()
print(translated)
print(end - start)