"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "78f5fe1416e74a2225e162e349cb8a53f1d39212"
Unverified Commit ab856f68 authored by h's avatar h Committed by GitHub
Browse files

Decouples `XLMProphet` model from `Prophet` (#19406)

* decouples xlm_prophet from prophet and adds copy patterns that pass the copy check

* adds copy patterns to copied docstrings too

* restores autodoc for XLMProphetNetModel

* removes all-casing in a bunch of places to ensure that the model is compatible with all checkpoints on the hub

* adds missing model to main init

* adds autodocs to make document checker happy

* adds missing pretrained model import

* adds missing pretrained model import to main init

* adds XLMProphetNetPreTrainedModel to the dummy pt objects

* removes examples from the source-doc file since docstrings contain them already

* adds a missing new line to make check_repo happy
parent c6646613
...@@ -2113,6 +2113,7 @@ else: ...@@ -2113,6 +2113,7 @@ else:
"XLMProphetNetForCausalLM", "XLMProphetNetForCausalLM",
"XLMProphetNetForConditionalGeneration", "XLMProphetNetForConditionalGeneration",
"XLMProphetNetModel", "XLMProphetNetModel",
"XLMProphetNetPreTrainedModel",
] ]
) )
_import_structure["models.xlm_roberta"].extend( _import_structure["models.xlm_roberta"].extend(
...@@ -4796,6 +4797,7 @@ if TYPE_CHECKING: ...@@ -4796,6 +4797,7 @@ if TYPE_CHECKING:
XLMProphetNetForCausalLM, XLMProphetNetForCausalLM,
XLMProphetNetForConditionalGeneration, XLMProphetNetForConditionalGeneration,
XLMProphetNetModel, XLMProphetNetModel,
XLMProphetNetPreTrainedModel,
) )
from .models.xlm_roberta import ( from .models.xlm_roberta import (
XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
......
...@@ -45,6 +45,7 @@ else: ...@@ -45,6 +45,7 @@ else:
"XLMProphetNetForCausalLM", "XLMProphetNetForCausalLM",
"XLMProphetNetForConditionalGeneration", "XLMProphetNetForConditionalGeneration",
"XLMProphetNetModel", "XLMProphetNetModel",
"XLMProphetNetPreTrainedModel",
] ]
...@@ -72,6 +73,7 @@ if TYPE_CHECKING: ...@@ -72,6 +73,7 @@ if TYPE_CHECKING:
XLMProphetNetForCausalLM, XLMProphetNetForCausalLM,
XLMProphetNetForConditionalGeneration, XLMProphetNetForConditionalGeneration,
XLMProphetNetModel, XLMProphetNetModel,
XLMProphetNetPreTrainedModel,
) )
else: else:
......
...@@ -5637,6 +5637,13 @@ class XLMProphetNetModel(metaclass=DummyObject): ...@@ -5637,6 +5637,13 @@ class XLMProphetNetModel(metaclass=DummyObject):
requires_backends(self, ["torch"]) requires_backends(self, ["torch"])
class XLMProphetNetPreTrainedModel(metaclass=DummyObject):
_backends = ["torch"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])
XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment