cognitivess commited on
Commit
89901a7
1 Parent(s): 4bd5e51

Update cognitivess_model/__init__.py

Browse files
Files changed (1) hide show
  1. cognitivess_model/__init__.py +5 -90
cognitivess_model/__init__.py CHANGED
@@ -1,91 +1,6 @@
1
- # Copyright 2023 Cognitivess 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_sentencepiece_available,
20
- is_tokenizers_available,
21
- is_torch_available,
22
- )
23
-
24
-
25
- _import_structure = {
26
- "configuration_cognitivess": ["CognitivessConfig"],
27
- }
28
-
29
- try:
30
- if not is_sentencepiece_available():
31
- raise OptionalDependencyNotAvailable()
32
- except OptionalDependencyNotAvailable:
33
- pass
34
- else:
35
- _import_structure["tokenization_cognitivess"] = ["CognitivessTokenizer"]
36
-
37
- try:
38
- if not is_tokenizers_available():
39
- raise OptionalDependencyNotAvailable()
40
- except OptionalDependencyNotAvailable:
41
- pass
42
- else:
43
- _import_structure["tokenization_cognitivess_fast"] = ["CognitivessTokenizerFast"]
44
-
45
- try:
46
- if not is_torch_available():
47
- raise OptionalDependencyNotAvailable()
48
- except OptionalDependencyNotAvailable:
49
- pass
50
- else:
51
- _import_structure["modeling_cognitivess"] = [
52
- "CognitivessForCausalLM",
53
- "CognitivessModel",
54
- "CognitivessPreTrainedModel",
55
- ]
56
-
57
- if TYPE_CHECKING:
58
- from .configuration_cognitivess import CognitivessConfig
59
-
60
- try:
61
- if not is_sentencepiece_available():
62
- raise OptionalDependencyNotAvailable()
63
- except OptionalDependencyNotAvailable:
64
- pass
65
- else:
66
- from .tokenization_cognitivess import CognitivessTokenizer
67
-
68
- try:
69
- if not is_tokenizers_available():
70
- raise OptionalDependencyNotAvailable()
71
- except OptionalDependencyNotAvailable:
72
- pass
73
- else:
74
- from .tokenization_cognitivess_fast import CognitivessTokenizerFast
75
-
76
- try:
77
- if not is_torch_available():
78
- raise OptionalDependencyNotAvailable()
79
- except OptionalDependencyNotAvailable:
80
- pass
81
- else:
82
- from .modeling_cognitivess import (
83
- CognitivessForCausalLM,
84
- CognitivessModel,
85
- CognitivessPreTrainedModel,
86
- )
87
-
88
- else:
89
- import sys
90
-
91
- sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
 
1
+ from .configuration_cognitivess import CognitivessConfig
2
+ from .modeling_cognitivess import CognitivessForCausalLM
3
+ from transformers import AutoConfig, AutoModelForCausalLM
 
 
 
 
 
 
 
 
 
 
 
4
 
5
+ AutoConfig.register("cognitivess", CognitivessConfig)
6
+ AutoModelForCausalLM.register(CognitivessConfig, CognitivessForCausalLM)