From 98717cb34110c35f6c6b65b8d5a4b9932cf3dd98 Mon Sep 17 00:00:00 2001 From: Utkarsha Gupte <89600822+UtkarshaGupte@users.noreply.github.com> Date: Wed, 17 Apr 2024 02:27:49 -0700 Subject: [PATCH] Configuring Translation Pipelines documents update #27753 (#29986) * Configuring Translation Pipelines documents update #27753 Configuring Translation Pipelines documents update * Language Format Addition * adding supported list of languages list --- docs/source/en/tasks/translation.md | 5 ++++- docs/source/ja/tasks/translation.md | 5 ++++- docs/source/ko/tasks/translation.md | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/source/en/tasks/translation.md b/docs/source/en/tasks/translation.md index f0433a0dad..2316b19578 100644 --- a/docs/source/en/tasks/translation.md +++ b/docs/source/en/tasks/translation.md @@ -348,7 +348,10 @@ The simplest way to try out your finetuned model for inference is to use it in a ```py >>> from transformers import pipeline ->>> translator = pipeline("translation", model="my_awesome_opus_books_model") +# Change `xx` to the language of the input and `yy` to the language of the desired output. +# Examples: "en" for English, "fr" for French, "de" for German, "es" for Spanish, "zh" for Chinese, etc; translation_en_to_fr translates English to French +# You can view all the lists of languages here - https://huggingface.co/languages +>>> translator = pipeline("translation_xx_to_yy", model="my_awesome_opus_books_model") >>> translator(text) [{'translation_text': 'Legumes partagent des ressources avec des bactéries azotantes.'}] ``` diff --git a/docs/source/ja/tasks/translation.md b/docs/source/ja/tasks/translation.md index fb2c89f385..187afe2687 100644 --- a/docs/source/ja/tasks/translation.md +++ b/docs/source/ja/tasks/translation.md @@ -349,7 +349,10 @@ TensorFlow でモデルを微調整するには、オプティマイザー関数 ```py >>> from transformers import pipeline ->>> translator = pipeline("translation", model="my_awesome_opus_books_model") +# Change `xx` to the language of the input and `yy` to the language of the desired output. +# Examples: "en" for English, "fr" for French, "de" for German, "es" for Spanish, "zh" for Chinese, etc; translation_en_to_fr translates English to French +# You can view all the lists of languages here - https://huggingface.co/languages +>>> translator = pipeline("translation_xx_to_yy", model="my_awesome_opus_books_model") >>> translator(text) [{'translation_text': 'Legumes partagent des ressources avec des bactéries azotantes.'}] ``` diff --git a/docs/source/ko/tasks/translation.md b/docs/source/ko/tasks/translation.md index 6de275f7d0..29560606be 100644 --- a/docs/source/ko/tasks/translation.md +++ b/docs/source/ko/tasks/translation.md @@ -346,7 +346,10 @@ TensorFlow에서 모델을 파인튜닝하려면 우선 optimizer 함수, 학습 ```py >>> from transformers import pipeline ->>> translator = pipeline("translation", model="my_awesome_opus_books_model") +# Change `xx` to the language of the input and `yy` to the language of the desired output. +# Examples: "en" for English, "fr" for French, "de" for German, "es" for Spanish, "zh" for Chinese, etc; translation_en_to_fr translates English to French +# You can view all the lists of languages here - https://huggingface.co/languages +>>> translator = pipeline("translation_xx_to_yy", model="my_awesome_opus_books_model") >>> translator(text) [{'translation_text': 'Legumes partagent des ressources avec des bactéries azotantes.'}] ```