Skip to content
Merged
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
1 change: 1 addition & 0 deletions mindone/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,7 @@
)
from .models.univnet import UnivNetModel
from .models.upernet import UperNetForSemanticSegmentation, UperNetPreTrainedModel
from .models.vaultgemma import VaultGemmaForCausalLM, VaultGemmaModel, VaultGemmaPreTrainedModel
from .models.video_llava import VideoLlavaForConditionalGeneration, VideoLlavaPreTrainedModel
from .models.videomae import (
VideoMAEForPreTraining,
Expand Down
1 change: 1 addition & 0 deletions mindone/transformers/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
unispeech_sat,
univnet,
upernet,
vaultgemma,
video_llava,
videomae,
vilt,
Expand Down
2 changes: 2 additions & 0 deletions mindone/transformers/models/auto/configuration_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
("unispeech-sat", "UniSpeechSatConfig"),
("univnet", "UnivNetConfig"),
("upernet", "UperNetConfig"),
("vaultgemma", "VaultGemmaConfig"),
("video_llava", "VideoLlavaConfig"),
("videomae", "VideoMAEConfig"),
("vilt", "ViltConfig"),
Expand Down Expand Up @@ -534,6 +535,7 @@
("unispeech-sat", "UniSpeechSat"),
("univnet", "UnivNet"),
("upernet", "UPerNet"),
("vaultgemma", "VaultGemma"),
("video_llava", "VideoLlava"),
("videomae", "VideoMAE"),
("vilt", "ViLT"),
Expand Down
2 changes: 2 additions & 0 deletions mindone/transformers/models/auto/modeling_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
("unispeech", "UniSpeechModel"),
("unispeech-sat", "UniSpeechSatModel"),
("univnet", "UnivNetModel"),
("vaultgemma", "VaultGemmaModel"),
("videomae", "VideoMAEModel"),
("vilt", "ViltModel"),
("visual_bert", "VisualBertModel"),
Expand Down Expand Up @@ -489,6 +490,7 @@
("stablelm", "StableLmForCausalLM"),
("starcoder2", "Starcoder2ForCausalLM"),
("trocr", "TrOCRForCausalLM"),
("vaultgemma", "VaultGemmaForCausalLM"),
("whisper", "WhisperForCausalLM"),
("xglm", "XGLMForCausalLM"),
("xlm", "XLMWithLMHeadModel"),
Expand Down
18 changes: 18 additions & 0 deletions mindone/transformers/models/vaultgemma/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding=utf-8
# Copyright 2025 the HuggingFace Team. All rights reserved.
#
# This code is adapted from https://github.com/huggingface/transformers
# with modifications to run transformers on mindspore.
#
# 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 .modeling_vaultgemma import *
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using a wildcard import (*) is generally discouraged by PEP 8 as it can lead to namespace pollution and makes it difficult to track where names are coming from. While I see this pattern is used elsewhere in the repository, it's a good practice to explicitly import the public API. This improves code readability and helps static analysis tools.

Suggested change
from .modeling_vaultgemma import *
from .modeling_vaultgemma import (
VaultGemmaForCausalLM,
VaultGemmaModel,
VaultGemmaPreTrainedModel,
)
__all__ = ["VaultGemmaForCausalLM", "VaultGemmaModel", "VaultGemmaPreTrainedModel"]

Loading