-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
2,788 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<!--Copyright 2022 The HuggingFace Team. All rights reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations under the License. | ||
--> | ||
|
||
# Ernie | ||
|
||
## Overview | ||
ERNIE is a series of powerful models proposed by baidu, especially in Chinese tasks, | ||
including [ERNIE1.0](https://arxiv.org/abs/1904.09223), [ERNIE2.0](https://ojs.aaai.org/index.php/AAAI/article/view/6428), | ||
[ERNIE3.0](https://arxiv.org/abs/2107.02137), [ERNIE-Gram](https://arxiv.org/abs/2010.12148), [ERNIE-health](https://arxiv.org/abs/2110.07244), etc. | ||
|
||
These models are contributed by [nghuyong](https://huggingface.co/nghuyong) and the official code can be found in [PaddleNLP](https://github.com/PaddlePaddle/PaddleNLP) (in PaddlePaddle). | ||
|
||
## ErnieConfig | ||
|
||
[[autodoc]] ErnieConfig | ||
- all | ||
|
||
## Ernie specific outputs | ||
|
||
[[autodoc]] models.ernie.modeling_ernie.ErnieForPreTrainingOutput | ||
|
||
## ErnieModel | ||
|
||
[[autodoc]] ErnieModel | ||
- forward | ||
|
||
## ErnieForPreTraining | ||
|
||
[[autodoc]] ErnieForPreTraining | ||
- forward | ||
|
||
## ErnieLMHeadModel | ||
|
||
[[autodoc]] ErnieLMHeadModel | ||
- forward | ||
|
||
## ErnieForMaskedLM | ||
|
||
[[autodoc]] ErnieForMaskedLM | ||
- forward | ||
|
||
## ErnieForNextSentencePrediction | ||
|
||
[[autodoc]] ErnieForNextSentencePrediction | ||
- forward | ||
|
||
## ErnieForSequenceClassification | ||
|
||
[[autodoc]] ErnieForSequenceClassification | ||
- forward | ||
|
||
## ErnieForMultipleChoice | ||
|
||
[[autodoc]] ErnieForMultipleChoice | ||
- forward | ||
|
||
## ErnieForTokenClassification | ||
|
||
[[autodoc]] ErnieForTokenClassification | ||
- forward | ||
|
||
## ErnieForQuestionAnswering | ||
|
||
[[autodoc]] ErnieForQuestionAnswering | ||
- forward |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
bartpho, | ||
beit, | ||
bert, | ||
ernie, | ||
bert_generation, | ||
bert_japanese, | ||
bertweet, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# flake8: noqa | ||
# There's no way to ignore "F401 '...' imported but unused" warnings in this | ||
# module, but to preserve other warnings. So, don't check this module at all. | ||
|
||
# Copyright 2022 The HuggingFace Team. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from ...utils import ( | ||
OptionalDependencyNotAvailable, | ||
_LazyModule, | ||
is_tensorflow_text_available, | ||
is_torch_available, | ||
) | ||
|
||
|
||
_import_structure = { | ||
"configuration_ernie": ["ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP", "ErnieConfig", "ErnieOnnxConfig"], | ||
} | ||
|
||
try: | ||
if not is_torch_available(): | ||
raise OptionalDependencyNotAvailable() | ||
except OptionalDependencyNotAvailable: | ||
pass | ||
else: | ||
_import_structure["modeling_ernie"] = [ | ||
"ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST", | ||
"ErnieForMaskedLM", | ||
"ErnieForMultipleChoice", | ||
"ErnieForNextSentencePrediction", | ||
"ErnieForPreTraining", | ||
"ErnieForQuestionAnswering", | ||
"ErnieForSequenceClassification", | ||
"ErnieForTokenClassification", | ||
"ErnieLayer", | ||
"ErnieLMHeadModel", | ||
"ErnieModel", | ||
"ErniePreTrainedModel", | ||
] | ||
|
||
try: | ||
if not is_tensorflow_text_available(): | ||
raise OptionalDependencyNotAvailable() | ||
except OptionalDependencyNotAvailable: | ||
pass | ||
else: | ||
_import_structure["tokenization_ernie_tf"] = ["TFBertTokenizer"] | ||
|
||
if TYPE_CHECKING: | ||
from .configuration_ernie import ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieConfig, ErnieOnnxConfig | ||
|
||
try: | ||
if not is_torch_available(): | ||
raise OptionalDependencyNotAvailable() | ||
except OptionalDependencyNotAvailable: | ||
pass | ||
else: | ||
from .modeling_ernie import ( | ||
ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST, | ||
ErnieForMaskedLM, | ||
ErnieForMultipleChoice, | ||
ErnieForNextSentencePrediction, | ||
ErnieForPreTraining, | ||
ErnieForQuestionAnswering, | ||
ErnieForSequenceClassification, | ||
ErnieForTokenClassification, | ||
ErnieLayer, | ||
ErnieLMHeadModel, | ||
ErnieModel, | ||
ErniePreTrainedModel, | ||
) | ||
|
||
else: | ||
import sys | ||
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__) |
Oops, something went wrong.