Update README.md
Browse files
README.md
CHANGED
@@ -57,10 +57,17 @@ pipeline_tag: translation
|
|
57 |
Below is a simple usage example in Python with [Hugging Face Transformers](https://github.com/huggingface/transformers):
|
58 |
|
59 |
```python
|
60 |
-
from transformers import
|
61 |
|
62 |
model_name = "barbaroo/nllb_200_600M_en_fo"
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
text = "Hello, how are you?"
|
66 |
translation = translator(text)
|
|
|
57 |
Below is a simple usage example in Python with [Hugging Face Transformers](https://github.com/huggingface/transformers):
|
58 |
|
59 |
```python
|
60 |
+
from transformers import pipeline
|
61 |
|
62 |
model_name = "barbaroo/nllb_200_600M_en_fo"
|
63 |
+
|
64 |
+
translator = pipeline(
|
65 |
+
"translation",
|
66 |
+
model=model_name,
|
67 |
+
tokenizer=model_name,
|
68 |
+
src_lang="eng_Latn", # Language code for English
|
69 |
+
tgt_lang="fao_Latn" # Language code for Faroese
|
70 |
+
)
|
71 |
|
72 |
text = "Hello, how are you?"
|
73 |
translation = translator(text)
|