Upload __init__.py
Browse files- __init__.py +82 -0
__init__.py
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright 2023 Mistral AI and The HuggingFace Inc. 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 at
|
6 |
+
#
|
7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
+
#
|
9 |
+
# Unless required by applicable law or agreed to in writing, software
|
10 |
+
# 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 and
|
13 |
+
# limitations under the License.
|
14 |
+
from typing import TYPE_CHECKING
|
15 |
+
|
16 |
+
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_torch_available
|
17 |
+
|
18 |
+
|
19 |
+
_import_structure = {
|
20 |
+
"configuration_mistral": ["MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP", "MistralConfig"],
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
try:
|
25 |
+
if not is_torch_available():
|
26 |
+
raise OptionalDependencyNotAvailable()
|
27 |
+
except OptionalDependencyNotAvailable:
|
28 |
+
pass
|
29 |
+
else:
|
30 |
+
_import_structure["modeling_mistral"] = [
|
31 |
+
"MistralForCausalLM",
|
32 |
+
"MistralModel",
|
33 |
+
"MistralPreTrainedModel",
|
34 |
+
"MistralForSequenceClassification",
|
35 |
+
]
|
36 |
+
|
37 |
+
try:
|
38 |
+
if not is_flax_available():
|
39 |
+
raise OptionalDependencyNotAvailable()
|
40 |
+
except OptionalDependencyNotAvailable:
|
41 |
+
pass
|
42 |
+
else:
|
43 |
+
_import_structure["modeling_flax_mistral"] = [
|
44 |
+
"FlaxMistralForCausalLM",
|
45 |
+
"FlaxMistralModel",
|
46 |
+
"FlaxMistralPreTrainedModel",
|
47 |
+
]
|
48 |
+
|
49 |
+
|
50 |
+
if TYPE_CHECKING:
|
51 |
+
from .configuration_mistral import MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP, MistralConfig
|
52 |
+
|
53 |
+
try:
|
54 |
+
if not is_torch_available():
|
55 |
+
raise OptionalDependencyNotAvailable()
|
56 |
+
except OptionalDependencyNotAvailable:
|
57 |
+
pass
|
58 |
+
else:
|
59 |
+
from .modeling_mistral import (
|
60 |
+
MistralForCausalLM,
|
61 |
+
MistralForSequenceClassification,
|
62 |
+
MistralModel,
|
63 |
+
MistralPreTrainedModel,
|
64 |
+
)
|
65 |
+
|
66 |
+
try:
|
67 |
+
if not is_flax_available():
|
68 |
+
raise OptionalDependencyNotAvailable()
|
69 |
+
except OptionalDependencyNotAvailable:
|
70 |
+
pass
|
71 |
+
else:
|
72 |
+
from .modeling_flax_mistral import (
|
73 |
+
FlaxMistralForCausalLM,
|
74 |
+
FlaxMistralModel,
|
75 |
+
FlaxMistralPreTrainedModel,
|
76 |
+
)
|
77 |
+
|
78 |
+
|
79 |
+
else:
|
80 |
+
import sys
|
81 |
+
|
82 |
+
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
|