cognitivess commited on
Commit
6d9bf6c
1 Parent(s): 5336c3e

Update cognitivess_model/__init__.py

Browse files
Files changed (1) hide show
  1. cognitivess_model/__init__.py +38 -38
cognitivess_model/__init__.py CHANGED
@@ -1,4 +1,4 @@
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.
@@ -17,7 +17,8 @@ from ...utils import (
17
  OptionalDependencyNotAvailable,
18
  _LazyModule,
19
  is_flax_available,
20
- is_tf_available,
 
21
  is_torch_available,
22
  )
23
 
@@ -26,6 +27,21 @@ _import_structure = {
26
  "configuration_Cognitivess": ["CognitivessConfig"],
27
  }
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  try:
31
  if not is_torch_available():
@@ -38,6 +54,7 @@ else:
38
  "CognitivessModel",
39
  "CognitivessPreTrainedModel",
40
  "CognitivessForSequenceClassification",
 
41
  "CognitivessForTokenClassification",
42
  ]
43
 
@@ -47,29 +64,28 @@ try:
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()
@@ -78,6 +94,7 @@ if TYPE_CHECKING:
78
  else:
79
  from .modeling_Cognitivess import (
80
  CognitivessForCausalLM,
 
81
  CognitivessForSequenceClassification,
82
  CognitivessForTokenClassification,
83
  CognitivessModel,
@@ -90,24 +107,7 @@ if TYPE_CHECKING:
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:
 
1
+ # Copyright 2022 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.
 
17
  OptionalDependencyNotAvailable,
18
  _LazyModule,
19
  is_flax_available,
20
+ is_sentencepiece_available,
21
+ is_tokenizers_available,
22
  is_torch_available,
23
  )
24
 
 
27
  "configuration_Cognitivess": ["CognitivessConfig"],
28
  }
29
 
30
+ try:
31
+ if not is_sentencepiece_available():
32
+ raise OptionalDependencyNotAvailable()
33
+ except OptionalDependencyNotAvailable:
34
+ pass
35
+ else:
36
+ _import_structure["tokenization_Cognitivess"] = ["CognitivessTokenizer"]
37
+
38
+ try:
39
+ if not is_tokenizers_available():
40
+ raise OptionalDependencyNotAvailable()
41
+ except OptionalDependencyNotAvailable:
42
+ pass
43
+ else:
44
+ _import_structure["tokenization_Cognitivess_fast"] = ["CognitivessTokenizerFast"]
45
 
46
  try:
47
  if not is_torch_available():
 
54
  "CognitivessModel",
55
  "CognitivessPreTrainedModel",
56
  "CognitivessForSequenceClassification",
57
+ "CognitivessForQuestionAnswering",
58
  "CognitivessForTokenClassification",
59
  ]
60
 
 
64
  except OptionalDependencyNotAvailable:
65
  pass
66
  else:
67
+ _import_structure["modeling_flax_Cognitivess"] = ["FlaxCognitivessForCausalLM", "FlaxCognitivessModel", "FlaxCognitivessPreTrainedModel"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
 
70
  if TYPE_CHECKING:
71
  from .configuration_Cognitivess import CognitivessConfig
72
 
73
+ try:
74
+ if not is_sentencepiece_available():
75
+ raise OptionalDependencyNotAvailable()
76
+ except OptionalDependencyNotAvailable:
77
+ pass
78
+ else:
79
+ from .tokenization_Cognitivess import CognitivessTokenizer
80
+
81
+ try:
82
+ if not is_tokenizers_available():
83
+ raise OptionalDependencyNotAvailable()
84
+ except OptionalDependencyNotAvailable:
85
+ pass
86
+ else:
87
+ from .tokenization_Cognitivess_fast import CognitivessTokenizerFast
88
+
89
  try:
90
  if not is_torch_available():
91
  raise OptionalDependencyNotAvailable()
 
94
  else:
95
  from .modeling_Cognitivess import (
96
  CognitivessForCausalLM,
97
+ CognitivessForQuestionAnswering,
98
  CognitivessForSequenceClassification,
99
  CognitivessForTokenClassification,
100
  CognitivessModel,
 
107
  except OptionalDependencyNotAvailable:
108
  pass
109
  else:
110
+ from .modeling_flax_Cognitivess import FlaxCognitivessForCausalLM, FlaxCognitivessModel, FlaxCognitivessPreTrainedModel
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
 
113
  else: