Translation
Transformers
PyTorch
English
Chinese
mbart
text2text-generation
fine tune
fine_tune
mbart-50
Instructions to use Normal1919/mbart-large-50-one-to-many-lil-fine-tune with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Normal1919/mbart-large-50-one-to-many-lil-fine-tune with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="Normal1919/mbart-large-50-one-to-many-lil-fine-tune")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Normal1919/mbart-large-50-one-to-many-lil-fine-tune") model = AutoModelForSeq2SeqLM.from_pretrained("Normal1919/mbart-large-50-one-to-many-lil-fine-tune", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
8f6bc96
1
Parent(s): 20ee01a
Update README.md
Browse files
README.md
CHANGED
|
@@ -41,9 +41,9 @@ pipeline_tag: translation
|
|
| 41 |
>>> mode_name = 'Normal1919/mbart-large-50-one-to-many-lil-fine-tune'
|
| 42 |
>>> model = MBartForConditionalGeneration.from_pretrained(mode_name)
|
| 43 |
>>> tokenizer = MBart50TokenizerFast.from_pretrained(mode_name, src_lang="en_XX", tgt_lang="zh_CN")
|
| 44 |
-
>>> translation = pipeline("
|
| 45 |
>>> translation('I {i} should {/i} say that I feel a little relieved to find out that {i}this {/i} is why you’ve been hanging out with Kaori lately, though. She’s really pretty and I got jealous and...I’m sorry', max_length=400)
|
| 46 |
-
[{'我{i}应该{/i}说发现{i}这{/i}是你最近和Kaori出去的原因
|
| 47 |
```
|
| 48 |
|
| 49 |
## Contact
|
|
|
|
| 41 |
>>> mode_name = 'Normal1919/mbart-large-50-one-to-many-lil-fine-tune'
|
| 42 |
>>> model = MBartForConditionalGeneration.from_pretrained(mode_name)
|
| 43 |
>>> tokenizer = MBart50TokenizerFast.from_pretrained(mode_name, src_lang="en_XX", tgt_lang="zh_CN")
|
| 44 |
+
>>> translation = pipeline("mbart-large-50-one-to-many-lil-fine-tune", model=model, tokenizer=tokenizer)
|
| 45 |
>>> translation('I {i} should {/i} say that I feel a little relieved to find out that {i}this {/i} is why you’ve been hanging out with Kaori lately, though. She’s really pretty and I got jealous and...I’m sorry', max_length=400)
|
| 46 |
+
[{'我{i}应该{/i}说,我有点松了一口气,发现{i}这个{/i}是你最近和Kaori一起出去玩的原因。她真的很漂亮,我嫉妒了,而且......对不起。'}]
|
| 47 |
```
|
| 48 |
|
| 49 |
## Contact
|