cognitivess commited on
Commit
b378755
1 Parent(s): 684cf6f

Update cognitivess_model/__init__.py

Browse files
Files changed (1) hide show
  1. cognitivess_model/__init__.py +116 -20
cognitivess_model/__init__.py CHANGED
@@ -1,20 +1,116 @@
1
- from .configuration_cognitivess import CognitivessConfig
2
- from .modeling_cognitivess import CognitivessForCausalLM
3
- from .tokenization_cognitivess import CognitivessTokenizer
4
- from .tokenization_cognitivess_fast import CognitivessTokenizerFast
5
-
6
- from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
7
-
8
- print("Registering CognitivessConfig...")
9
- AutoConfig.register("cognitivess", CognitivessConfig)
10
- print("CognitivessConfig registered successfully.")
11
-
12
- print("Registering CognitivessForCausalLM...")
13
- AutoModelForCausalLM.register(CognitivessConfig, CognitivessForCausalLM)
14
- print("CognitivessForCausalLM registered successfully.")
15
-
16
- print("Registering CognitivessTokenizer and CognitivessTokenizerFast...")
17
- AutoTokenizer.register(CognitivessConfig,
18
- slow_tokenizer_class=CognitivessTokenizer,
19
- fast_tokenizer_class=CognitivessTokenizerFast)
20
- print("CognitivessTokenizer and CognitivessTokenizerFast registered successfully.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2023 Cognitivess 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 (
17
+ OptionalDependencyNotAvailable,
18
+ _LazyModule,
19
+ is_flax_available,
20
+ is_tf_available,
21
+ is_torch_available,
22
+ )
23
+
24
+
25
+ _import_structure = {
26
+ "configuration_Cognitivess": ["CognitivessConfig"],
27
+ }
28
+
29
+
30
+ try:
31
+ if not is_torch_available():
32
+ raise OptionalDependencyNotAvailable()
33
+ except OptionalDependencyNotAvailable:
34
+ pass
35
+ else:
36
+ _import_structure["modeling_Cognitivess"] = [
37
+ "CognitivessForCausalLM",
38
+ "CognitivessModel",
39
+ "CognitivessPreTrainedModel",
40
+ "CognitivessForSequenceClassification",
41
+ "CognitivessForTokenClassification",
42
+ ]
43
+
44
+ try:
45
+ if not is_flax_available():
46
+ raise OptionalDependencyNotAvailable()
47
+ except OptionalDependencyNotAvailable:
48
+ pass
49
+ else:
50
+ _import_structure["modeling_flax_Cognitivess"] = [
51
+ "FlaxCognitivessForCausalLM",
52
+ "FlaxCognitivessModel",
53
+ "FlaxCognitivessPreTrainedModel",
54
+ ]
55
+
56
+ try:
57
+ if not is_tf_available():
58
+ raise OptionalDependencyNotAvailable()
59
+ except OptionalDependencyNotAvailable:
60
+ pass
61
+ else:
62
+ _import_structure["modeling_tf_Cognitivess"] = [
63
+ "TFCognitivessModel",
64
+ "TFCognitivessForCausalLM",
65
+ "TFCognitivessForSequenceClassification",
66
+ "TFCognitivessPreTrainedModel",
67
+ ]
68
+
69
+
70
+ if TYPE_CHECKING:
71
+ from .configuration_Cognitivess import CognitivessConfig
72
+
73
+ try:
74
+ if not is_torch_available():
75
+ raise OptionalDependencyNotAvailable()
76
+ except OptionalDependencyNotAvailable:
77
+ pass
78
+ else:
79
+ from .modeling_Cognitivess import (
80
+ CognitivessForCausalLM,
81
+ CognitivessForSequenceClassification,
82
+ CognitivessForTokenClassification,
83
+ CognitivessModel,
84
+ CognitivessPreTrainedModel,
85
+ )
86
+
87
+ try:
88
+ if not is_flax_available():
89
+ raise OptionalDependencyNotAvailable()
90
+ except OptionalDependencyNotAvailable:
91
+ pass
92
+ else:
93
+ from .modeling_flax_Cognitivess import (
94
+ FlaxCognitivessForCausalLM,
95
+ FlaxCognitivessModel,
96
+ FlaxCognitivessPreTrainedModel,
97
+ )
98
+
99
+ try:
100
+ if not is_tf_available():
101
+ raise OptionalDependencyNotAvailable()
102
+ except OptionalDependencyNotAvailable:
103
+ pass
104
+ else:
105
+ from .modeling_tf_Cognitivess import (
106
+ TFCognitivessForCausalLM,
107
+ TFCognitivessForSequenceClassification,
108
+ TFCognitivessModel,
109
+ TFCognitivessPreTrainedModel,
110
+ )
111
+
112
+
113
+ else:
114
+ import sys
115
+
116
+ sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)