CoolFace
Modelpublic

nhuvo/nllb-600m-en-vimedner-mt-en2vi

sourceHugging Facecc-by-nc-4.0updated 1mo agoView on Hugging Face
1likes18downloads
Model Card

nllb-600m-en-vimedner-mt-en2vi

`facebook/nllb-200-distilled-600M` fine-tuned for English → Vietnamese biomedical translation on En-ViMedNER.

Dataset details, splits, and citation: [nhuvo/En-ViMedNER](https://huggingface.co/datasets/nhuvo/En-ViMedNER).

Usage

python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

repo = "nhuvo/nllb-600m-en-vimedner-mt-en2vi"
tok = AutoTokenizer.from_pretrained(repo, src_lang="eng_Latn")
model = AutoModelForSeq2SeqLM.from_pretrained(repo)

text = "Patients with type 2 diabetes mellitus were enrolled."
inputs = tok(text, return_tensors="pt")
outputs = model.generate(
    **inputs,
    forced_bos_token_id=tok.convert_tokens_to_ids("vie_Latn"),
    max_new_tokens=256,
)
print(tok.batch_decode(outputs, skip_special_tokens=True)[0])

Related