DoruC/Grounded-Segment-Anything
0
1# Copyright 2021 The HuggingFace Team. All rights reserved.2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12# See the License for the specific language governing permissions and13# limitations under the License.14from typing import TYPE_CHECKING15 16from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available17 18 19_import_structure = {"configuration_visual_bert": ["VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "VisualBertConfig"]}20 21try:22 if not is_torch_available():23 raise OptionalDependencyNotAvailable()24except OptionalDependencyNotAvailable:25 pass26else:27 _import_structure["modeling_visual_bert"] = [28 "VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST",29 "VisualBertForMultipleChoice",30 "VisualBertForPreTraining",31 "VisualBertForQuestionAnswering",32 "VisualBertForRegionToPhraseAlignment",33 "VisualBertForVisualReasoning",34 "VisualBertLayer",35 "VisualBertModel",36 "VisualBertPreTrainedModel",37 ]38 39 40if TYPE_CHECKING:41 from .configuration_visual_bert import VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, VisualBertConfig42 43 try:44 if not is_torch_available():45 raise OptionalDependencyNotAvailable()46 except OptionalDependencyNotAvailable:47 pass48 else:49 from .modeling_visual_bert import (50 VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,51 VisualBertForMultipleChoice,52 VisualBertForPreTraining,53 VisualBertForQuestionAnswering,54 VisualBertForRegionToPhraseAlignment,55 VisualBertForVisualReasoning,56 VisualBertLayer,57 VisualBertModel,58 VisualBertPreTrainedModel,59 )60 61 62else:63 import sys64 65 sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)66 