Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
8395f14d
Unverified
Commit
8395f14d
authored
Dec 10, 2021
by
Yih-Dar
Committed by
GitHub
Dec 10, 2021
Browse files
Fix doc examples: KeyError (#14699)
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
bab15564
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
3 deletions
+1
-3
src/transformers/models/blenderbot_small/modeling_blenderbot_small.py
...mers/models/blenderbot_small/modeling_blenderbot_small.py
+0
-1
src/transformers/models/blenderbot_small/modeling_tf_blenderbot_small.py
...s/models/blenderbot_small/modeling_tf_blenderbot_small.py
+1
-2
No files found.
src/transformers/models/blenderbot_small/modeling_blenderbot_small.py
View file @
8395f14d
...
...
@@ -512,7 +512,6 @@ BLENDERBOT_SMALL_GENERATION_EXAMPLE = r"""
>>> UTTERANCE = "My friends are cool but they eat too many carbs."
>>> print("Human: ", UTTERANCE)
>>> inputs = tokenizer([UTTERANCE], return_tensors='pt')
>>> inputs.pop("token_type_ids")
>>> reply_ids = model.generate(**inputs)
>>> print("Bot: ", tokenizer.batch_decode(reply_ids, skip_special_tokens=True)[0])
what kind of carbs do they eat? i don't know much about carbs.
...
...
src/transformers/models/blenderbot_small/modeling_tf_blenderbot_small.py
View file @
8395f14d
...
...
@@ -517,12 +517,11 @@ BLENDERBOT_SMALL_GENERATION_EXAMPLE = r"""
>>> from transformers import BlenderbotSmallTokenizer, TFBlenderbotSmallForConditionalGeneration
>>> mname = 'facebook/blenderbot_small-90M'
>>> model = BlenderbotSmallForConditionalGeneration.from_pretrained(mname)
>>> tokenizer =
TF
BlenderbotSmallTokenizer.from_pretrained(mname)
>>> tokenizer = BlenderbotSmallTokenizer.from_pretrained(mname)
>>> UTTERANCE = "My friends are cool but they eat too many carbs."
>>> print("Human: ", UTTERANCE)
>>> inputs = tokenizer([UTTERANCE], return_tensors='tf')
>>> inputs.pop("token_type_ids")
>>> reply_ids = model.generate(**inputs)
>>> print("Bot: ", tokenizer.batch_decode(reply_ids, skip_special_tokens=True)[0])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment