How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
# Warning: Pipeline type "translation" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline

pipe = pipeline("translation", model="chi-vi/hirashiba-mt-tiny-zh-vi")
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("chi-vi/hirashiba-mt-tiny-zh-vi")
model = AutoModelForSeq2SeqLM.from_pretrained("chi-vi/hirashiba-mt-tiny-zh-vi", device_map="auto")
Quick Links

Hirashiba ^^

Hirashiba

Hira's intelligence, Shiba's speed

Hirashiba-MT-zh-vi is a model used for gatekeeping and refilling water.

Usage

                                                              
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)
Downloads last month
78
Safetensors
Model size
14.8M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Datasets used to train chi-vi/hirashiba-mt-tiny-zh-vi

Spaces using chi-vi/hirashiba-mt-tiny-zh-vi 3