"...resnet50_tensorflow.git" did not exist on "9f3f80e2b22923b3f7e270e1fe8abef4486da966"
Unverified Commit 63517fdf authored by Suraj Patil's avatar Suraj Patil Committed by GitHub
Browse files

[M2M100 doc] remove duplicate example (#17175)

* remove duplicate example

* remove code block
parent 4a419d49
...@@ -565,7 +565,7 @@ M2M_100_START_DOCSTRING = r""" ...@@ -565,7 +565,7 @@ M2M_100_START_DOCSTRING = r"""
""" """
M2M_100_GENERATION_EXAMPLE = r""" M2M_100_GENERATION_EXAMPLE = r"""
Translation example:: Translation example:
```python ```python
>>> from transformers import M2M100Tokenizer, M2M100ForConditionalGeneration >>> from transformers import M2M100Tokenizer, M2M100ForConditionalGeneration
...@@ -1299,22 +1299,7 @@ class M2M100ForConditionalGeneration(M2M100PreTrainedModel): ...@@ -1299,22 +1299,7 @@ class M2M100ForConditionalGeneration(M2M100PreTrainedModel):
(masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`. (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
Returns: Returns:
"""
Example:
```python
>>> from transformers import M2M100Tokenizer, M2M100ForConditionalGeneration
>>> model = M2M100ForConditionalGeneration.from_pretrained("facebook/m2m100_418M")
>>> tokenizer = M2M100Tokenizer.from_pretrained("facebook/m2m100_418M")
>>> text_to_translate = "Life is like a box of chocolates"
>>> model_inputs = tokenizer(text_to_translate, return_tensors="pt")
>>> # translate to French
>>> gen_tokens = model.generate(**model_inputs, forced_bos_token_id=tokenizer.get_lang_id("fr"))
>>> print(tokenizer.batch_decode(gen_tokens, skip_special_tokens=True))
```"""
return_dict = return_dict if return_dict is not None else self.config.use_return_dict return_dict = return_dict if return_dict is not None else self.config.use_return_dict
if labels is not None: if labels is not None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment