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
6c3b1315
Commit
6c3b1315
authored
Sep 26, 2019
by
thomwolf
Browse files
typo in readme/doc
parent
f83b35b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
README.md
README.md
+3
-3
docs/source/model_doc/xlm.rst
docs/source/model_doc/xlm.rst
+1
-1
No files found.
README.md
View file @
6c3b1315
...
@@ -207,7 +207,7 @@ Let's do a quick example of how a TensorFlow 2.0 model can be trained in 12 line
...
@@ -207,7 +207,7 @@ Let's do a quick example of how a TensorFlow 2.0 model can be trained in 12 line
```
python
```
python
import
tensorflow
as
tf
import
tensorflow
as
tf
import
tensorflow_datasets
import
tensorflow_datasets
from
pytorch_
transformers
import
*
from
transformers
import
*
# Load dataset, tokenizer, model from pretrained model/vocabulary
# Load dataset, tokenizer, model from pretrained model/vocabulary
tokenizer
=
BertTokenizer
.
from_pretrained
(
'bert-base-cased'
)
tokenizer
=
BertTokenizer
.
from_pretrained
(
'bert-base-cased'
)
...
@@ -215,8 +215,8 @@ model = TFBertForSequenceClassification.from_pretrained('bert-base-cased')
...
@@ -215,8 +215,8 @@ model = TFBertForSequenceClassification.from_pretrained('bert-base-cased')
data
=
tensorflow_datasets
.
load
(
'glue/mrpc'
)
data
=
tensorflow_datasets
.
load
(
'glue/mrpc'
)
# Prepare dataset for GLUE as a tf.data.Dataset instance
# Prepare dataset for GLUE as a tf.data.Dataset instance
train_dataset
=
glue_convert_examples_to_features
(
data
[
'train'
],
tokenizer
,
128
,
'mrpc'
)
train_dataset
=
glue_convert_examples_to_features
(
data
[
'train'
],
tokenizer
,
max_length
=
128
,
task
=
'mrpc'
)
valid_dataset
=
glue_convert_examples_to_features
(
data
[
'validation'
],
tokenizer
,
128
,
'mrpc'
)
valid_dataset
=
glue_convert_examples_to_features
(
data
[
'validation'
],
tokenizer
,
max_length
=
128
,
task
=
'mrpc'
)
train_dataset
=
train_dataset
.
shuffle
(
100
).
batch
(
32
).
repeat
(
2
)
train_dataset
=
train_dataset
.
shuffle
(
100
).
batch
(
32
).
repeat
(
2
)
valid_dataset
=
valid_dataset
.
batch
(
64
)
valid_dataset
=
valid_dataset
.
batch
(
64
)
...
...
docs/source/model_doc/xlm.rst
View file @
6c3b1315
...
@@ -44,7 +44,7 @@ XLM
...
@@ -44,7 +44,7 @@ XLM
``TFXLMModel``
``TFXLMModel``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass::
pytorch_
transformers.TFXLMModel
.. autoclass:: transformers.TFXLMModel
:members:
:members:
...
...
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