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
73198509
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "cb56590111b8f20eb8fc8e51d362b7acb092f19c"
Unverified
Commit
73198509
authored
Dec 09, 2022
by
amyeroberts
Committed by
GitHub
Dec 09, 2022
Browse files
Replace FE references (#20702)
parent
a95fd354
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
src/transformers/models/donut/processing_donut.py
src/transformers/models/donut/processing_donut.py
+5
-5
src/transformers/models/flava/processing_flava.py
src/transformers/models/flava/processing_flava.py
+4
-4
src/transformers/models/vilt/processing_vilt.py
src/transformers/models/vilt/processing_vilt.py
+5
-5
No files found.
src/transformers/models/donut/processing_donut.py
View file @
73198509
...
@@ -27,13 +27,13 @@ class DonutProcessor(ProcessorMixin):
...
@@ -27,13 +27,13 @@ class DonutProcessor(ProcessorMixin):
Constructs a Donut processor which wraps a Donut image processor and an XLMRoBERTa tokenizer into a single
Constructs a Donut processor which wraps a Donut image processor and an XLMRoBERTa tokenizer into a single
processor.
processor.
[`DonutProcessor`] offers all the functionalities of [`Donut
FeatureExtract
or`] and
[`DonutProcessor`] offers all the functionalities of [`Donut
ImageProcess
or`] and
[`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`]. See the [`~DonutProcessor.__call__`] and
[`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`]. See the [`~DonutProcessor.__call__`] and
[`~DonutProcessor.decode`] for more information.
[`~DonutProcessor.decode`] for more information.
Args:
Args:
image_processor ([`Donut
FeatureExtract
or`]):
image_processor ([`Donut
ImageProcess
or`]):
An instance of [`Donut
FeatureExtract
or`]. The image processor is a required input.
An instance of [`Donut
ImageProcess
or`]. The image processor is a required input.
tokenizer ([`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`]):
tokenizer ([`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`]):
An instance of [`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`]. The tokenizer is a required input.
An instance of [`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`]. The tokenizer is a required input.
"""
"""
...
@@ -62,8 +62,8 @@ class DonutProcessor(ProcessorMixin):
...
@@ -62,8 +62,8 @@ class DonutProcessor(ProcessorMixin):
def
__call__
(
self
,
*
args
,
**
kwargs
):
def
__call__
(
self
,
*
args
,
**
kwargs
):
"""
"""
When used in normal mode, this method forwards all its arguments to Auto
FeatureExtract
or's
When used in normal mode, this method forwards all its arguments to Auto
ImageProcess
or's
[`~Auto
FeatureExtract
or.__call__`] and returns its output. If used in the context
[`~Auto
ImageProcess
or.__call__`] and returns its output. If used in the context
[`~DonutProcessor.as_target_processor`] this method forwards all its arguments to DonutTokenizer's
[`~DonutProcessor.as_target_processor`] this method forwards all its arguments to DonutTokenizer's
[`~DonutTokenizer.__call__`]. Please refer to the doctsring of the above two methods for more information.
[`~DonutTokenizer.__call__`]. Please refer to the doctsring of the above two methods for more information.
"""
"""
...
...
src/transformers/models/flava/processing_flava.py
View file @
73198509
...
@@ -29,15 +29,15 @@ class FlavaProcessor(ProcessorMixin):
...
@@ -29,15 +29,15 @@ class FlavaProcessor(ProcessorMixin):
r
"""
r
"""
Constructs a FLAVA processor which wraps a FLAVA image processor and a FLAVA tokenizer into a single processor.
Constructs a FLAVA processor which wraps a FLAVA image processor and a FLAVA tokenizer into a single processor.
[`FlavaProcessor`] offers all the functionalities of [`Flava
FeatureExtract
or`] and [`BertTokenizerFast`]. See the
[`FlavaProcessor`] offers all the functionalities of [`Flava
ImageProcess
or`] and [`BertTokenizerFast`]. See the
[`~FlavaProcessor.__call__`] and [`~FlavaProcessor.decode`] for more information.
[`~FlavaProcessor.__call__`] and [`~FlavaProcessor.decode`] for more information.
Args:
Args:
image_processor ([`Flava
FeatureExtract
or`]): The image processor is a required input.
image_processor ([`Flava
ImageProcess
or`]): The image processor is a required input.
tokenizer ([`BertTokenizerFast`]): The tokenizer is a required input.
tokenizer ([`BertTokenizerFast`]): The tokenizer is a required input.
"""
"""
attributes
=
[
"image_processor"
,
"tokenizer"
]
attributes
=
[
"image_processor"
,
"tokenizer"
]
image_processor_class
=
"Flava
FeatureExtract
or"
image_processor_class
=
"Flava
ImageProcess
or"
tokenizer_class
=
(
"BertTokenizer"
,
"BertTokenizerFast"
)
tokenizer_class
=
(
"BertTokenizer"
,
"BertTokenizerFast"
)
def
__init__
(
self
,
image_processor
=
None
,
tokenizer
=
None
,
**
kwargs
):
def
__init__
(
self
,
image_processor
=
None
,
tokenizer
=
None
,
**
kwargs
):
...
@@ -81,7 +81,7 @@ class FlavaProcessor(ProcessorMixin):
...
@@ -81,7 +81,7 @@ class FlavaProcessor(ProcessorMixin):
**
kwargs
**
kwargs
):
):
"""
"""
This method uses [`F
LAVAFeatureExtract
or.__call__`] method to prepare image(s) for the model, and
This method uses [`F
lavaImageProcess
or.__call__`] method to prepare image(s) for the model, and
[`BertTokenizerFast.__call__`] to prepare text for the model.
[`BertTokenizerFast.__call__`] to prepare text for the model.
Please refer to the docstring of the above two methods for more information.
Please refer to the docstring of the above two methods for more information.
...
...
src/transformers/models/vilt/processing_vilt.py
View file @
73198509
...
@@ -28,17 +28,17 @@ class ViltProcessor(ProcessorMixin):
...
@@ -28,17 +28,17 @@ class ViltProcessor(ProcessorMixin):
r
"""
r
"""
Constructs a ViLT processor which wraps a BERT tokenizer and ViLT image processor into a single processor.
Constructs a ViLT processor which wraps a BERT tokenizer and ViLT image processor into a single processor.
[`ViltProcessor`] offers all the functionalities of [`Vilt
FeatureExtract
or`] and [`BertTokenizerFast`]. See the
[`ViltProcessor`] offers all the functionalities of [`Vilt
ImageProcess
or`] and [`BertTokenizerFast`]. See the
docstring of [`~ViltProcessor.__call__`] and [`~ViltProcessor.decode`] for more information.
docstring of [`~ViltProcessor.__call__`] and [`~ViltProcessor.decode`] for more information.
Args:
Args:
image_processor (`Vilt
FeatureExtract
or`):
image_processor (`Vilt
ImageProcess
or`):
An instance of [`Vilt
FeatureExtract
or`]. The image processor is a required input.
An instance of [`Vilt
ImageProcess
or`]. The image processor is a required input.
tokenizer (`BertTokenizerFast`):
tokenizer (`BertTokenizerFast`):
An instance of ['BertTokenizerFast`]. The tokenizer is a required input.
An instance of ['BertTokenizerFast`]. The tokenizer is a required input.
"""
"""
attributes
=
[
"image_processor"
,
"tokenizer"
]
attributes
=
[
"image_processor"
,
"tokenizer"
]
image_processor_class
=
"Vilt
FeatureExtract
or"
image_processor_class
=
"Vilt
ImageProcess
or"
tokenizer_class
=
(
"BertTokenizer"
,
"BertTokenizerFast"
)
tokenizer_class
=
(
"BertTokenizer"
,
"BertTokenizerFast"
)
def
__init__
(
self
,
image_processor
=
None
,
tokenizer
=
None
,
**
kwargs
):
def
__init__
(
self
,
image_processor
=
None
,
tokenizer
=
None
,
**
kwargs
):
...
@@ -80,7 +80,7 @@ class ViltProcessor(ProcessorMixin):
...
@@ -80,7 +80,7 @@ class ViltProcessor(ProcessorMixin):
**
kwargs
**
kwargs
)
->
BatchEncoding
:
)
->
BatchEncoding
:
"""
"""
This method uses [`Vilt
FeatureExtract
or.__call__`] method to prepare image(s) for the model, and
This method uses [`Vilt
ImageProcess
or.__call__`] method to prepare image(s) for the model, and
[`BertTokenizerFast.__call__`] to prepare text for the model.
[`BertTokenizerFast.__call__`] to prepare text for the model.
Please refer to the docstring of the above two methods for more information.
Please refer to the docstring of the above two methods for more information.
...
...
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