Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoSwin Backbone #1808

Open
wants to merge 8 commits into
base: keras-hub
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions keras_nlp/api/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
from keras_nlp.src.models.bloom.bloom_tokenizer import BloomTokenizer
from keras_nlp.src.models.causal_lm import CausalLM
from keras_nlp.src.models.classifier import Classifier
from keras_nlp.src.models.csp_darknet.csp_darknet_backbone import (
CSPDarkNetBackbone,
)
from keras_nlp.src.models.csp_darknet.csp_darknet_image_classifier import (
CSPDarkNetImageClassifier,
)
from keras_nlp.src.models.deberta_v3.deberta_v3_backbone import (
DebertaV3Backbone,
)
Expand All @@ -68,6 +74,10 @@
from keras_nlp.src.models.deberta_v3.deberta_v3_tokenizer import (
DebertaV3Tokenizer,
)
from keras_nlp.src.models.densenet.densenet_backbone import DenseNetBackbone
from keras_nlp.src.models.densenet.densenet_image_classifier import (
DenseNetImageClassifier,
)
from keras_nlp.src.models.distil_bert.distil_bert_backbone import (
DistilBertBackbone,
)
Expand Down Expand Up @@ -106,6 +116,7 @@
)
from keras_nlp.src.models.falcon.falcon_preprocessor import FalconPreprocessor
from keras_nlp.src.models.falcon.falcon_tokenizer import FalconTokenizer
from keras_nlp.src.models.feature_pyramid_backbone import FeaturePyramidBackbone
from keras_nlp.src.models.gemma.gemma_backbone import GemmaBackbone
from keras_nlp.src.models.gemma.gemma_causal_lm import GemmaCausalLM
from keras_nlp.src.models.gemma.gemma_causal_lm_preprocessor import (
Expand All @@ -129,6 +140,7 @@
GPTNeoXPreprocessor,
)
from keras_nlp.src.models.gpt_neo_x.gpt_neo_x_tokenizer import GPTNeoXTokenizer
from keras_nlp.src.models.image_classifier import ImageClassifier
from keras_nlp.src.models.llama3.llama3_backbone import Llama3Backbone
from keras_nlp.src.models.llama3.llama3_causal_lm import Llama3CausalLM
from keras_nlp.src.models.llama3.llama3_causal_lm_preprocessor import (
Expand Down Expand Up @@ -180,6 +192,10 @@
from keras_nlp.src.models.phi3.phi3_preprocessor import Phi3Preprocessor
from keras_nlp.src.models.phi3.phi3_tokenizer import Phi3Tokenizer
from keras_nlp.src.models.preprocessor import Preprocessor
from keras_nlp.src.models.resnet.resnet_backbone import ResNetBackbone
from keras_nlp.src.models.resnet.resnet_image_classifier import (
ResNetImageClassifier,
)
from keras_nlp.src.models.roberta.roberta_backbone import RobertaBackbone
from keras_nlp.src.models.roberta.roberta_classifier import RobertaClassifier
from keras_nlp.src.models.roberta.roberta_masked_lm import RobertaMaskedLM
Expand All @@ -194,6 +210,8 @@
from keras_nlp.src.models.t5.t5_backbone import T5Backbone
from keras_nlp.src.models.t5.t5_tokenizer import T5Tokenizer
from keras_nlp.src.models.task import Task
from keras_nlp.src.models.vgg.vgg_backbone import VGGBackbone
from keras_nlp.src.models.vgg.vgg_image_classifier import VGGImageClassifier
from keras_nlp.src.models.whisper.whisper_audio_feature_extractor import (
WhisperAudioFeatureExtractor,
)
Expand Down
3 changes: 3 additions & 0 deletions keras_nlp/src/models/backbone.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from keras_nlp.src.utils.preset_utils import save_metadata
from keras_nlp.src.utils.preset_utils import save_serialized_object
from keras_nlp.src.utils.python_utils import classproperty
from keras_nlp.src.utils.timm.convert import load_timm_backbone
from keras_nlp.src.utils.transformers.convert import load_transformers_backbone


Expand Down Expand Up @@ -204,6 +205,8 @@ class like `keras_nlp.models.Backbone.from_preset()`, or from

if format == "transformers":
return load_transformers_backbone(cls, preset, load_weights)
elif format == "timm":
return load_timm_backbone(cls, preset, load_weights, **kwargs)

preset_cls = check_config_class(preset)
if not issubclass(preset_cls, cls):
Expand Down
13 changes: 13 additions & 0 deletions keras_nlp/src/models/csp_darknet/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 The KerasNLP Authors
#
# 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
#
# https://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.
Loading
Loading