Skip to content

Commit

Permalink
fix init
Browse files Browse the repository at this point in the history
  • Loading branch information
kashif committed Feb 6, 2024
1 parent d025cb4 commit dde4ced
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Flax), PyTorch, and/or TensorFlow.
| [InstructBLIP](model_doc/instructblip) ||||
| [Jukebox](model_doc/jukebox) ||||
| [KOSMOS-2](model_doc/kosmos-2) ||||
| [LagLlama](model_doc/lagllama) | |||
| [LagLlama](model_doc/lagllama) | |||
| [LayoutLM](model_doc/layoutlm) ||||
| [LayoutLMv2](model_doc/layoutlmv2) ||||
| [LayoutLMv3](model_doc/layoutlmv3) ||||
Expand Down
16 changes: 16 additions & 0 deletions src/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@
"models.levit": ["LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "LevitConfig"],
"models.lilt": ["LILT_PRETRAINED_CONFIG_ARCHIVE_MAP", "LiltConfig"],
"models.llama": ["LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "LlamaConfig"],
"models.lagllama": ["LAGLLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "LagLlamaConfig"],
"models.llava": [
"LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP",
"LlavaConfig",
Expand Down Expand Up @@ -2489,6 +2490,14 @@
"LlamaPreTrainedModel",
]
)
_import_structure["models.lagllama"].extend(
[
"LagLlamaForPrediction",
"LagLlamaForSequenceClassification",
"LagLlamaModel",
"LagLlamaPreTrainedModel",
]
)
_import_structure["models.llava"].extend(
[
"LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST",
Expand Down Expand Up @@ -5262,6 +5271,7 @@
Kosmos2Config,
Kosmos2Processor,
)
from .models.lagllama import LAGLLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, LagLlamaConfig
from .models.layoutlm import (
LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP,
LayoutLMConfig,
Expand Down Expand Up @@ -6978,6 +6988,12 @@
Kosmos2Model,
Kosmos2PreTrainedModel,
)
from .models.lagllama import (
LagLlamaForPrediction,
LagLlamaForSequenceClassification,
LagLlamaModel,
LagLlamaPreTrainedModel,
)
from .models.layoutlm import (
LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST,
LayoutLMForMaskedLM,
Expand Down
28 changes: 28 additions & 0 deletions src/transformers/utils/dummy_pt_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -4454,6 +4454,34 @@ def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])


class LagLlamaForPrediction(metaclass=DummyObject):
_backends = ["torch"]

def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])


class LagLlamaForSequenceClassification(metaclass=DummyObject):
_backends = ["torch"]

def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])


class LagLlamaModel(metaclass=DummyObject):
_backends = ["torch"]

def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])


class LagLlamaPreTrainedModel(metaclass=DummyObject):
_backends = ["torch"]

def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])


LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = None


Expand Down

0 comments on commit dde4ced

Please sign in to comment.