# 等待下载
#--de-zh---
https://huggingface.co/Helsinki-NLP/opus-mt-de-ZH/tree/main
https://huggingface.co/Helsinki-NLP/opus-tatoeba-es-zh
https://huggingface.co/Helsinki-NLP/opus-mt-ja-en
https://huggingface.co/Helsinki-NLP/opus-mt-fr-en
https://huggingface.co/Helsinki-NLP/opus-mt-es-en
https://huggingface.co/Helsinki-NLP/opus-mt-ar-en
https://huggingface.co/Helsinki-NLP/opus-mt-th-en
https://huggingface.co/Helsinki-NLP/opus-mt-it-en
https://huggingface.co/Helsinki-NLP/opus-mt-tc-big-it-en
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-ru-en") model = AutoModelForSeq2SeqLM.from_pretrained("Helsinki-NLP/opus-mt-ru-en")
# ----------------------------------------------------------
from transformers import pipeline
translator = pipeline("translation", model="Helsinki-NLP/opus-mt-fr-en") # 自行下载模型
translator("Ce cours est produit par Hugging Face.")
[{'translation_text': 'This course is produced by Hugging Face.'}]
标签:NLP,co,Helsinki,抱脸,huggingface,mt,opus From: https://www.cnblogs.com/banyanisdora/p/17922198.html