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
fec76a48
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "1efc208ff386fb6df56302c8f6f9484ddf93b92a"
Unverified
Commit
fec76a48
authored
Jul 23, 2019
by
Thomas Wolf
Committed by
GitHub
Jul 23, 2019
Browse files
Update readme
parent
859c4417
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
README.md
README.md
+2
-1
No files found.
README.md
View file @
fec76a48
...
@@ -82,7 +82,8 @@ for model_class, tokenizer_class, pretrained_weights in MODELS:
...
@@ -82,7 +82,8 @@ for model_class, tokenizer_class, pretrained_weights in MODELS:
# Encode text
# Encode text
input_ids
=
torch
.
tensor
([
tokenizer
.
encode
(
"Here is some text to encode"
)])
input_ids
=
torch
.
tensor
([
tokenizer
.
encode
(
"Here is some text to encode"
)])
last_hidden_states
=
model
(
input_ids
)[
0
]
# Models outputs are now tuples
with
torch
.
no_grad
():
last_hidden_states
=
model
(
input_ids
)[
0
]
# Models outputs are now tuples
# Each architecture is provided with several class for fine-tuning on down-stream tasks, e.g.
# Each architecture is provided with several class for fine-tuning on down-stream tasks, e.g.
BERT_MODEL_CLASSES
=
[
BertModel
,
BertForPreTraining
,
BertForMaskedLM
,
BertForNextSentencePrediction
,
BERT_MODEL_CLASSES
=
[
BertModel
,
BertForPreTraining
,
BertForMaskedLM
,
BertForNextSentencePrediction
,
...
...
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