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
This commit is contained in:
Utkarsha Gupte
2024-04-17 02:27:49 -07:00
committed by GitHub
parent 080b700805
commit 98717cb341
3 changed files with 12 additions and 3 deletions

View File

@@ -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.'}]
```