optimum-rbln 0.8.3a1__py3-none-any.whl → 0.8.3a3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of optimum-rbln might be problematic. Click here for more details.
- optimum/rbln/__init__.py +10 -0
- optimum/rbln/__version__.py +16 -3
- optimum/rbln/diffusers/__init__.py +6 -0
- optimum/rbln/diffusers/pipelines/__init__.py +10 -0
- optimum/rbln/diffusers/pipelines/auto_pipeline.py +237 -0
- optimum/rbln/transformers/__init__.py +4 -0
- optimum/rbln/transformers/models/__init__.py +2 -0
- optimum/rbln/transformers/models/depth_anything/__init__.py +16 -0
- optimum/rbln/transformers/models/depth_anything/configuration_depth_anything.py +24 -0
- optimum/rbln/transformers/models/depth_anything/modeling_depth_anything.py +25 -0
- {optimum_rbln-0.8.3a1.dist-info → optimum_rbln-0.8.3a3.dist-info}/METADATA +1 -1
- {optimum_rbln-0.8.3a1.dist-info → optimum_rbln-0.8.3a3.dist-info}/RECORD +14 -10
- {optimum_rbln-0.8.3a1.dist-info → optimum_rbln-0.8.3a3.dist-info}/WHEEL +0 -0
- {optimum_rbln-0.8.3a1.dist-info → optimum_rbln-0.8.3a3.dist-info}/licenses/LICENSE +0 -0
optimum/rbln/__init__.py
CHANGED
|
@@ -81,6 +81,8 @@ _import_structure = {
|
|
|
81
81
|
"RBLNDistilBertForQuestionAnsweringConfig",
|
|
82
82
|
"RBLNDPTForDepthEstimation",
|
|
83
83
|
"RBLNDPTForDepthEstimationConfig",
|
|
84
|
+
"RBLNDepthAnythingForDepthEstimationConfig",
|
|
85
|
+
"RBLNDepthAnythingForDepthEstimation",
|
|
84
86
|
"RBLNExaoneForCausalLM",
|
|
85
87
|
"RBLNExaoneForCausalLMConfig",
|
|
86
88
|
"RBLNGemmaModel",
|
|
@@ -169,6 +171,9 @@ _import_structure = {
|
|
|
169
171
|
"RBLNAutoencoderKLConfig",
|
|
170
172
|
"RBLNAutoencoderKLCosmos",
|
|
171
173
|
"RBLNAutoencoderKLCosmosConfig",
|
|
174
|
+
"RBLNAutoPipelineForImage2Image",
|
|
175
|
+
"RBLNAutoPipelineForInpainting",
|
|
176
|
+
"RBLNAutoPipelineForText2Image",
|
|
172
177
|
"RBLNControlNetModel",
|
|
173
178
|
"RBLNControlNetModelConfig",
|
|
174
179
|
"RBLNCosmosTextToWorldPipeline",
|
|
@@ -238,6 +243,9 @@ if TYPE_CHECKING:
|
|
|
238
243
|
RBLNAutoencoderKLConfig,
|
|
239
244
|
RBLNAutoencoderKLCosmos,
|
|
240
245
|
RBLNAutoencoderKLCosmosConfig,
|
|
246
|
+
RBLNAutoPipelineForImage2Image,
|
|
247
|
+
RBLNAutoPipelineForInpainting,
|
|
248
|
+
RBLNAutoPipelineForText2Image,
|
|
241
249
|
RBLNControlNetModel,
|
|
242
250
|
RBLNControlNetModelConfig,
|
|
243
251
|
RBLNCosmosSafetyChecker,
|
|
@@ -346,6 +354,8 @@ if TYPE_CHECKING:
|
|
|
346
354
|
RBLNDecoderOnlyModelConfig,
|
|
347
355
|
RBLNDecoderOnlyModelForCausalLM,
|
|
348
356
|
RBLNDecoderOnlyModelForCausalLMConfig,
|
|
357
|
+
RBLNDepthAnythingForDepthEstimation,
|
|
358
|
+
RBLNDepthAnythingForDepthEstimationConfig,
|
|
349
359
|
RBLNDistilBertForQuestionAnswering,
|
|
350
360
|
RBLNDistilBertForQuestionAnsweringConfig,
|
|
351
361
|
RBLNDPTForDepthEstimation,
|
optimum/rbln/__version__.py
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
# file generated by setuptools-scm
|
|
2
2
|
# don't change, don't track in version control
|
|
3
3
|
|
|
4
|
-
__all__ = [
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
5
12
|
|
|
6
13
|
TYPE_CHECKING = False
|
|
7
14
|
if TYPE_CHECKING:
|
|
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
|
|
|
9
16
|
from typing import Union
|
|
10
17
|
|
|
11
18
|
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
12
20
|
else:
|
|
13
21
|
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
14
23
|
|
|
15
24
|
version: str
|
|
16
25
|
__version__: str
|
|
17
26
|
__version_tuple__: VERSION_TUPLE
|
|
18
27
|
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
19
30
|
|
|
20
|
-
__version__ = version = '0.8.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 8, 3, '
|
|
31
|
+
__version__ = version = '0.8.3a3'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 8, 3, 'a3')
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = None
|
|
@@ -59,6 +59,9 @@ _import_structure = {
|
|
|
59
59
|
"RBLNVQModelConfig",
|
|
60
60
|
],
|
|
61
61
|
"pipelines": [
|
|
62
|
+
"RBLNAutoPipelineForImage2Image",
|
|
63
|
+
"RBLNAutoPipelineForInpainting",
|
|
64
|
+
"RBLNAutoPipelineForText2Image",
|
|
62
65
|
"RBLNCosmosTextToWorldPipeline",
|
|
63
66
|
"RBLNCosmosVideoToWorldPipeline",
|
|
64
67
|
"RBLNCosmosSafetyChecker",
|
|
@@ -144,6 +147,9 @@ if TYPE_CHECKING:
|
|
|
144
147
|
RBLNVQModel,
|
|
145
148
|
)
|
|
146
149
|
from .pipelines import (
|
|
150
|
+
RBLNAutoPipelineForImage2Image,
|
|
151
|
+
RBLNAutoPipelineForInpainting,
|
|
152
|
+
RBLNAutoPipelineForText2Image,
|
|
147
153
|
RBLNCosmosSafetyChecker,
|
|
148
154
|
RBLNCosmosTextToWorldPipeline,
|
|
149
155
|
RBLNCosmosVideoToWorldPipeline,
|
|
@@ -18,6 +18,11 @@ from transformers.utils import _LazyModule
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
_import_structure = {
|
|
21
|
+
"auto_pipeline": [
|
|
22
|
+
"RBLNAutoPipelineForImage2Image",
|
|
23
|
+
"RBLNAutoPipelineForInpainting",
|
|
24
|
+
"RBLNAutoPipelineForText2Image",
|
|
25
|
+
],
|
|
21
26
|
"controlnet": [
|
|
22
27
|
"RBLNMultiControlNetModel",
|
|
23
28
|
"RBLNStableDiffusionControlNetImg2ImgPipeline",
|
|
@@ -56,6 +61,11 @@ _import_structure = {
|
|
|
56
61
|
],
|
|
57
62
|
}
|
|
58
63
|
if TYPE_CHECKING:
|
|
64
|
+
from .auto_pipeline import (
|
|
65
|
+
RBLNAutoPipelineForImage2Image,
|
|
66
|
+
RBLNAutoPipelineForInpainting,
|
|
67
|
+
RBLNAutoPipelineForText2Image,
|
|
68
|
+
)
|
|
59
69
|
from .controlnet import (
|
|
60
70
|
RBLNMultiControlNetModel,
|
|
61
71
|
RBLNStableDiffusionControlNetImg2ImgPipeline,
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Copyright 2025 Rebellions Inc. 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
|
+
|
|
15
|
+
|
|
16
|
+
import importlib
|
|
17
|
+
from typing import Type
|
|
18
|
+
|
|
19
|
+
from diffusers.models.controlnets import ControlNetUnionModel
|
|
20
|
+
from diffusers.pipelines.auto_pipeline import (
|
|
21
|
+
AUTO_IMAGE2IMAGE_PIPELINES_MAPPING,
|
|
22
|
+
AUTO_INPAINT_PIPELINES_MAPPING,
|
|
23
|
+
AUTO_TEXT2IMAGE_PIPELINES_MAPPING,
|
|
24
|
+
AutoPipelineForImage2Image,
|
|
25
|
+
AutoPipelineForInpainting,
|
|
26
|
+
AutoPipelineForText2Image,
|
|
27
|
+
_get_task_class,
|
|
28
|
+
)
|
|
29
|
+
from huggingface_hub.utils import validate_hf_hub_args
|
|
30
|
+
|
|
31
|
+
from optimum.rbln.modeling_base import RBLNBaseModel
|
|
32
|
+
from optimum.rbln.utils.model_utils import (
|
|
33
|
+
MODEL_MAPPING,
|
|
34
|
+
convert_hf_to_rbln_model_name,
|
|
35
|
+
convert_rbln_to_hf_model_name,
|
|
36
|
+
get_rbln_model_cls,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class RBLNAutoPipelineBase:
|
|
41
|
+
_model_mapping = None
|
|
42
|
+
_model_mapping_names = None
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def get_rbln_cls(cls, pretrained_model_name_or_path, export=True, **kwargs):
|
|
46
|
+
if export:
|
|
47
|
+
hf_model_class = cls.infer_hf_model_class(pretrained_model_name_or_path, **kwargs)
|
|
48
|
+
rbln_class_name = convert_hf_to_rbln_model_name(hf_model_class.__name__)
|
|
49
|
+
else:
|
|
50
|
+
rbln_class_name = cls.get_rbln_model_cls_name(pretrained_model_name_or_path, **kwargs)
|
|
51
|
+
if convert_rbln_to_hf_model_name(rbln_class_name) not in cls._model_mapping_names:
|
|
52
|
+
raise ValueError(
|
|
53
|
+
f"The architecture '{rbln_class_name}' is not supported by the `{cls.__name__}.from_pretrained()` method. "
|
|
54
|
+
"Please use the `from_pretrained()` method of the appropriate class to load this model, "
|
|
55
|
+
f"or directly use '{rbln_class_name}.from_pretrained()`."
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
rbln_cls = get_rbln_model_cls(rbln_class_name)
|
|
60
|
+
except AttributeError as e:
|
|
61
|
+
raise AttributeError(
|
|
62
|
+
f"Class '{rbln_class_name}' not found in 'optimum.rbln' module for model ID '{pretrained_model_name_or_path}'. "
|
|
63
|
+
"Ensure that the class name is correctly mapped and available in the 'optimum.rbln' module."
|
|
64
|
+
) from e
|
|
65
|
+
|
|
66
|
+
return rbln_cls
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def get_rbln_model_cls_name(cls, pretrained_model_name_or_path, **kwargs):
|
|
70
|
+
"""
|
|
71
|
+
Retrieve the path to the compiled model directory for a given RBLN model.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
pretrained_model_name_or_path (str): Identifier of the model.
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
str: Path to the compiled model directory.
|
|
78
|
+
"""
|
|
79
|
+
model_index_config = cls.load_config(pretrained_model_name_or_path)
|
|
80
|
+
|
|
81
|
+
if "_class_name" not in model_index_config:
|
|
82
|
+
raise ValueError(
|
|
83
|
+
"The `_class_name` field is missing from model_index_config. This is unexpected and should be reported as an issue. "
|
|
84
|
+
"Please use the `from_pretrained()` method of the appropriate class to load this model."
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
return model_index_config["_class_name"]
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def infer_hf_model_class(
|
|
91
|
+
cls,
|
|
92
|
+
pretrained_model_or_path,
|
|
93
|
+
cache_dir=None,
|
|
94
|
+
force_download=False,
|
|
95
|
+
proxies=None,
|
|
96
|
+
token=None,
|
|
97
|
+
local_files_only=False,
|
|
98
|
+
revision=None,
|
|
99
|
+
**kwargs,
|
|
100
|
+
):
|
|
101
|
+
config = cls.load_config(
|
|
102
|
+
pretrained_model_or_path,
|
|
103
|
+
cache_dir=cache_dir,
|
|
104
|
+
force_download=force_download,
|
|
105
|
+
proxies=proxies,
|
|
106
|
+
token=token,
|
|
107
|
+
local_files_only=local_files_only,
|
|
108
|
+
revision=revision,
|
|
109
|
+
)
|
|
110
|
+
pipeline_key_name = cls.get_pipeline_key_name(config, **kwargs)
|
|
111
|
+
|
|
112
|
+
pipeline_cls = _get_task_class(cls._model_mapping, pipeline_key_name)
|
|
113
|
+
|
|
114
|
+
return pipeline_cls
|
|
115
|
+
|
|
116
|
+
@classmethod
|
|
117
|
+
def get_pipeline_key_name(cls, config, **kwargs):
|
|
118
|
+
orig_class_name = config["_class_name"]
|
|
119
|
+
if "ControlPipeline" in orig_class_name:
|
|
120
|
+
to_replace = "ControlPipeline"
|
|
121
|
+
else:
|
|
122
|
+
to_replace = "Pipeline"
|
|
123
|
+
|
|
124
|
+
if "controlnet" in kwargs:
|
|
125
|
+
if isinstance(kwargs["controlnet"], ControlNetUnionModel):
|
|
126
|
+
orig_class_name = config["_class_name"].replace(to_replace, "ControlNetUnionPipeline")
|
|
127
|
+
else:
|
|
128
|
+
orig_class_name = config["_class_name"].replace(to_replace, "ControlNetPipeline")
|
|
129
|
+
if "enable_pag" in kwargs:
|
|
130
|
+
enable_pag = kwargs.pop("enable_pag")
|
|
131
|
+
if enable_pag:
|
|
132
|
+
orig_class_name = orig_class_name.replace(to_replace, "PAGPipeline")
|
|
133
|
+
|
|
134
|
+
return orig_class_name
|
|
135
|
+
|
|
136
|
+
@classmethod
|
|
137
|
+
@validate_hf_hub_args
|
|
138
|
+
def from_pretrained(cls, model_id, **kwargs):
|
|
139
|
+
rbln_cls = cls.get_rbln_cls(model_id, **kwargs)
|
|
140
|
+
return rbln_cls.from_pretrained(model_id, **kwargs)
|
|
141
|
+
|
|
142
|
+
@classmethod
|
|
143
|
+
def from_model(cls, model, **kwargs):
|
|
144
|
+
rbln_cls = get_rbln_model_cls(f"RBLN{model.__class__.__name__}")
|
|
145
|
+
return rbln_cls.from_model(model, **kwargs)
|
|
146
|
+
|
|
147
|
+
@staticmethod
|
|
148
|
+
def register(rbln_cls: Type[RBLNBaseModel], exist_ok=False):
|
|
149
|
+
"""
|
|
150
|
+
Register a new RBLN model class.
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
rbln_cls (Type[RBLNBaseModel]): The RBLN model class to register.
|
|
154
|
+
exist_ok (bool): Whether to allow registering an already registered model.
|
|
155
|
+
"""
|
|
156
|
+
if not issubclass(rbln_cls, RBLNBaseModel):
|
|
157
|
+
raise ValueError("`rbln_cls` must be a subclass of RBLNBaseModel.")
|
|
158
|
+
|
|
159
|
+
native_cls = getattr(importlib.import_module("optimum.rbln"), rbln_cls.__name__, None)
|
|
160
|
+
if rbln_cls.__name__ in MODEL_MAPPING or native_cls is not None:
|
|
161
|
+
if not exist_ok:
|
|
162
|
+
raise ValueError(f"Model for {rbln_cls.__name__} already registered.")
|
|
163
|
+
|
|
164
|
+
MODEL_MAPPING[rbln_cls.__name__] = rbln_cls
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class RBLNAutoPipelineForText2Image(RBLNAutoPipelineBase, AutoPipelineForText2Image):
|
|
168
|
+
_model_mapping = AUTO_TEXT2IMAGE_PIPELINES_MAPPING
|
|
169
|
+
_model_mapping_names = {x[0]: x[1].__name__ for x in AUTO_TEXT2IMAGE_PIPELINES_MAPPING.items()}
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class RBLNAutoPipelineForImage2Image(RBLNAutoPipelineBase, AutoPipelineForImage2Image):
|
|
173
|
+
_model_mapping = AUTO_IMAGE2IMAGE_PIPELINES_MAPPING
|
|
174
|
+
_model_mapping_names = {x[0]: x[1].__name__ for x in AUTO_IMAGE2IMAGE_PIPELINES_MAPPING.items()}
|
|
175
|
+
|
|
176
|
+
@classmethod
|
|
177
|
+
def get_pipeline_key_name(cls, config, **kwargs):
|
|
178
|
+
orig_class_name = config["_class_name"]
|
|
179
|
+
# the `orig_class_name` can be:
|
|
180
|
+
# `- *Pipeline` (for regular text-to-image checkpoint)
|
|
181
|
+
# - `*ControlPipeline` (for Flux tools specific checkpoint)
|
|
182
|
+
# `- *Img2ImgPipeline` (for refiner checkpoint)
|
|
183
|
+
if "Img2Img" in orig_class_name:
|
|
184
|
+
to_replace = "Img2ImgPipeline"
|
|
185
|
+
elif "ControlPipeline" in orig_class_name:
|
|
186
|
+
to_replace = "ControlPipeline"
|
|
187
|
+
else:
|
|
188
|
+
to_replace = "Pipeline"
|
|
189
|
+
|
|
190
|
+
if "controlnet" in kwargs:
|
|
191
|
+
if isinstance(kwargs["controlnet"], ControlNetUnionModel):
|
|
192
|
+
orig_class_name = orig_class_name.replace(to_replace, "ControlNetUnion" + to_replace)
|
|
193
|
+
else:
|
|
194
|
+
orig_class_name = orig_class_name.replace(to_replace, "ControlNet" + to_replace)
|
|
195
|
+
if "enable_pag" in kwargs:
|
|
196
|
+
enable_pag = kwargs.pop("enable_pag")
|
|
197
|
+
if enable_pag:
|
|
198
|
+
orig_class_name = orig_class_name.replace(to_replace, "PAG" + to_replace)
|
|
199
|
+
|
|
200
|
+
if to_replace == "ControlPipeline":
|
|
201
|
+
orig_class_name = orig_class_name.replace(to_replace, "ControlImg2ImgPipeline")
|
|
202
|
+
|
|
203
|
+
return orig_class_name
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
class RBLNAutoPipelineForInpainting(RBLNAutoPipelineBase, AutoPipelineForInpainting):
|
|
207
|
+
_model_mapping = AUTO_INPAINT_PIPELINES_MAPPING
|
|
208
|
+
_model_mapping_names = {x[0]: x[1].__name__ for x in AUTO_INPAINT_PIPELINES_MAPPING.items()}
|
|
209
|
+
|
|
210
|
+
@classmethod
|
|
211
|
+
def get_pipeline_key_name(cls, config, **kwargs):
|
|
212
|
+
orig_class_name = config["_class_name"]
|
|
213
|
+
|
|
214
|
+
# The `orig_class_name`` can be:
|
|
215
|
+
# `- *InpaintPipeline` (for inpaint-specific checkpoint)
|
|
216
|
+
# - `*ControlPipeline` (for Flux tools specific checkpoint)
|
|
217
|
+
# - or *Pipeline (for regular text-to-image checkpoint)
|
|
218
|
+
if "Inpaint" in orig_class_name:
|
|
219
|
+
to_replace = "InpaintPipeline"
|
|
220
|
+
elif "ControlPipeline" in orig_class_name:
|
|
221
|
+
to_replace = "ControlPipeline"
|
|
222
|
+
else:
|
|
223
|
+
to_replace = "Pipeline"
|
|
224
|
+
|
|
225
|
+
if "controlnet" in kwargs:
|
|
226
|
+
if isinstance(kwargs["controlnet"], ControlNetUnionModel):
|
|
227
|
+
orig_class_name = orig_class_name.replace(to_replace, "ControlNetUnion" + to_replace)
|
|
228
|
+
else:
|
|
229
|
+
orig_class_name = orig_class_name.replace(to_replace, "ControlNet" + to_replace)
|
|
230
|
+
if "enable_pag" in kwargs:
|
|
231
|
+
enable_pag = kwargs.pop("enable_pag")
|
|
232
|
+
if enable_pag:
|
|
233
|
+
orig_class_name = orig_class_name.replace(to_replace, "PAG" + to_replace)
|
|
234
|
+
if to_replace == "ControlPipeline":
|
|
235
|
+
orig_class_name = orig_class_name.replace(to_replace, "ControlInpaintPipeline")
|
|
236
|
+
|
|
237
|
+
return orig_class_name
|
|
@@ -69,6 +69,8 @@ _import_structure = {
|
|
|
69
69
|
"RBLNDistilBertForQuestionAnsweringConfig",
|
|
70
70
|
"RBLNDPTForDepthEstimation",
|
|
71
71
|
"RBLNDPTForDepthEstimationConfig",
|
|
72
|
+
"RBLNDepthAnythingForDepthEstimation",
|
|
73
|
+
"RBLNDepthAnythingForDepthEstimationConfig",
|
|
72
74
|
"RBLNExaoneForCausalLM",
|
|
73
75
|
"RBLNExaoneForCausalLMConfig",
|
|
74
76
|
"RBLNGemmaModel",
|
|
@@ -204,6 +206,8 @@ if TYPE_CHECKING:
|
|
|
204
206
|
RBLNDecoderOnlyModelConfig,
|
|
205
207
|
RBLNDecoderOnlyModelForCausalLM,
|
|
206
208
|
RBLNDecoderOnlyModelForCausalLMConfig,
|
|
209
|
+
RBLNDepthAnythingForDepthEstimation,
|
|
210
|
+
RBLNDepthAnythingForDepthEstimationConfig,
|
|
207
211
|
RBLNDistilBertForQuestionAnswering,
|
|
208
212
|
RBLNDistilBertForQuestionAnsweringConfig,
|
|
209
213
|
RBLNDPTForDepthEstimation,
|
|
@@ -90,6 +90,7 @@ _import_structure = {
|
|
|
90
90
|
"RBLNDecoderOnlyModelForCausalLM",
|
|
91
91
|
"RBLNDecoderOnlyModelForCausalLMConfig",
|
|
92
92
|
],
|
|
93
|
+
"depth_anything": ["RBLNDepthAnythingForDepthEstimationConfig", "RBLNDepthAnythingForDepthEstimation"],
|
|
93
94
|
"dpt": [
|
|
94
95
|
"RBLNDPTForDepthEstimation",
|
|
95
96
|
"RBLNDPTForDepthEstimationConfig",
|
|
@@ -219,6 +220,7 @@ if TYPE_CHECKING:
|
|
|
219
220
|
RBLNDecoderOnlyModelForCausalLM,
|
|
220
221
|
RBLNDecoderOnlyModelForCausalLMConfig,
|
|
221
222
|
)
|
|
223
|
+
from .depth_anything import RBLNDepthAnythingForDepthEstimation, RBLNDepthAnythingForDepthEstimationConfig
|
|
222
224
|
from .distilbert import RBLNDistilBertForQuestionAnswering, RBLNDistilBertForQuestionAnsweringConfig
|
|
223
225
|
from .dpt import RBLNDPTForDepthEstimation, RBLNDPTForDepthEstimationConfig
|
|
224
226
|
from .exaone import RBLNExaoneForCausalLM, RBLNExaoneForCausalLMConfig
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Copyright 2025 Rebellions Inc. 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
|
+
|
|
15
|
+
from .configuration_depth_anything import RBLNDepthAnythingForDepthEstimationConfig
|
|
16
|
+
from .modeling_depth_anything import RBLNDepthAnythingForDepthEstimation
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Copyright 2025 Rebellions Inc. 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
|
+
|
|
15
|
+
from ...configuration_generic import RBLNModelForDepthEstimationConfig
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class RBLNDepthAnythingForDepthEstimationConfig(RBLNModelForDepthEstimationConfig):
|
|
19
|
+
"""
|
|
20
|
+
Configuration class for DepthAnythingForDepthEstimation.
|
|
21
|
+
|
|
22
|
+
This configuration class stores the configuration parameters specific to
|
|
23
|
+
RBLN-optimized Depth Anything V2 Small models for depth estimation tasks.
|
|
24
|
+
"""
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Copyright 2025 Rebellions Inc. 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
|
+
|
|
15
|
+
|
|
16
|
+
from ...modeling_generic import RBLNModelForDepthEstimation
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class RBLNDepthAnythingForDepthEstimation(RBLNModelForDepthEstimation):
|
|
20
|
+
"""
|
|
21
|
+
RBLN optimized DepthAnythingForDepthEstimation model for depth estimation tasks.
|
|
22
|
+
|
|
23
|
+
This class provides hardware-accelerated inference for Depth Anything V2 Small
|
|
24
|
+
models on RBLN devices, providing the most capable monocular depth estimation (MDE) model.
|
|
25
|
+
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: optimum-rbln
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.3a3
|
|
4
4
|
Summary: Optimum RBLN is the interface between the HuggingFace Transformers and Diffusers libraries and RBLN accelerators. It provides a set of tools enabling easy model loading and inference on single and multiple rbln device settings for different downstream tasks.
|
|
5
5
|
Project-URL: Homepage, https://rebellions.ai
|
|
6
6
|
Project-URL: Documentation, https://docs.rbln.ai
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
optimum/rbln/__init__.py,sha256=
|
|
2
|
-
optimum/rbln/__version__.py,sha256=
|
|
1
|
+
optimum/rbln/__init__.py,sha256=uudbkt6M2dI7hyBqnKI7Rw_DcOo6Dye4VdEgHw0Kj2w,17578
|
|
2
|
+
optimum/rbln/__version__.py,sha256=NC494o_z1A8m7nK7GwomeE3oY1ddXSWewbtXIl6IJmQ,712
|
|
3
3
|
optimum/rbln/configuration_utils.py,sha256=xneqnRWSUVROqpzbTrBACex42-L9zwo3eSjfHjFuhv4,33072
|
|
4
4
|
optimum/rbln/modeling.py,sha256=0CMQnpVvW9evNrTFHM2XFbNpRY1HkbFzYJ5sRyYFq0o,14293
|
|
5
5
|
optimum/rbln/modeling_base.py,sha256=gHfqIO6lKT8smkUthUuRHnbITpxHpnDeBPT8iTeasCk,24575
|
|
6
|
-
optimum/rbln/diffusers/__init__.py,sha256=
|
|
6
|
+
optimum/rbln/diffusers/__init__.py,sha256=1tgU_xWA42BmInqu9bBz_5R_E9TGhhK3mI06YlaiTLg,7232
|
|
7
7
|
optimum/rbln/diffusers/modeling_diffusers.py,sha256=TAuMb7PSMjNwK7mh5ItE_CtAEgYeZKI27XkFFmxjHlQ,19902
|
|
8
8
|
optimum/rbln/diffusers/configurations/__init__.py,sha256=vMRnPY4s-Uju43xP038D2EA18X_mhy2YfsZVpSU-VoA,1322
|
|
9
9
|
optimum/rbln/diffusers/configurations/models/__init__.py,sha256=7q95gtgDzCeIBogGw8SLQoHT4Wch7vpLJVF2UQovuoo,567
|
|
@@ -35,7 +35,8 @@ optimum/rbln/diffusers/models/transformers/transformer_cosmos.py,sha256=UQ_R7RVJ
|
|
|
35
35
|
optimum/rbln/diffusers/models/transformers/transformer_sd3.py,sha256=yF7sS0QvawowpV9hR5GeT8DaE8CCp3mj1njHHd9cKTc,6630
|
|
36
36
|
optimum/rbln/diffusers/models/unets/__init__.py,sha256=MaICuK9CWjgzejXy8y2NDrphuEq1rkzanF8u45k6O5I,655
|
|
37
37
|
optimum/rbln/diffusers/models/unets/unet_2d_condition.py,sha256=v3WS9EGKROE_QClXrxC7rmRko1BspAvAbeIfh83LK88,15832
|
|
38
|
-
optimum/rbln/diffusers/pipelines/__init__.py,sha256=
|
|
38
|
+
optimum/rbln/diffusers/pipelines/__init__.py,sha256=r8mu21102cKXdkG1II9tpfpUS6wuyren2oK9y_MptZY,3703
|
|
39
|
+
optimum/rbln/diffusers/pipelines/auto_pipeline.py,sha256=oGZWXfj82w695D2NiYUitgoWiwP2Z4PlgA3q6hoOKww,9502
|
|
39
40
|
optimum/rbln/diffusers/pipelines/controlnet/__init__.py,sha256=n1Ef22TSeax-kENi_d8K6wGGHSNEo9QkUeygELHgcao,983
|
|
40
41
|
optimum/rbln/diffusers/pipelines/controlnet/multicontrolnet.py,sha256=3S9dogIHW8Bqg5kIlCudhCQG-4g3FcdOPEWhBOf7CJA,4059
|
|
41
42
|
optimum/rbln/diffusers/pipelines/controlnet/pipeline_controlnet.py,sha256=G96bh4D9Cu-w4F9gZBQF6wNzhJQv9kvI34ZFsuEDjSw,35714
|
|
@@ -71,13 +72,13 @@ optimum/rbln/ops/flash_attn.py,sha256=yTCdYQVqm_1rHMHWjrMQaIR8WTuG_xA6t033x1IVvT
|
|
|
71
72
|
optimum/rbln/ops/kv_cache_update.py,sha256=aIvK2Sp7M3EfJzJgNvIvAJv4emoN6QOhmgaWj-VboLs,1440
|
|
72
73
|
optimum/rbln/ops/linear.py,sha256=5K3pcrrUHu_p8LrMIU-jX2TnafksveFjjZSCsYSp_yw,1328
|
|
73
74
|
optimum/rbln/ops/sliding_window_attn.py,sha256=EQrV_yRGc5z6kvwEsAcLP028bJWkQg2UPI3xubt9skU,3487
|
|
74
|
-
optimum/rbln/transformers/__init__.py,sha256=
|
|
75
|
+
optimum/rbln/transformers/__init__.py,sha256=2Xe086vpwskJzN9bujkuRkBV96Ov54kYmAB7gPjOh-U,11323
|
|
75
76
|
optimum/rbln/transformers/configuration_generic.py,sha256=95ks6REJYuzI1zLwGlPSlxVV45saVcYOob6ihn-WAAY,5092
|
|
76
77
|
optimum/rbln/transformers/modeling_attention_utils.py,sha256=aLyOaq4me1m-JMmnKbuyNQageDxNU2jjEhGE_ew2P5o,11465
|
|
77
78
|
optimum/rbln/transformers/modeling_generic.py,sha256=2BtroigKuu7z7C98dpLwI875R0EoHN-ceHEVbyPQuYk,12212
|
|
78
79
|
optimum/rbln/transformers/modeling_outputs.py,sha256=cd8ZlhHAGq7S6i5-QK6TJCxgORvoPMnZpqPBlUc_pMY,1177
|
|
79
80
|
optimum/rbln/transformers/modeling_rope_utils.py,sha256=6Zg3r-TeUk4WQAlr95pqfhuoAD_RQ4njT1rbO9uPL0Q,14379
|
|
80
|
-
optimum/rbln/transformers/models/__init__.py,sha256=
|
|
81
|
+
optimum/rbln/transformers/models/__init__.py,sha256=IYF1F4TZDfTBlfT3howesi_lNlQe-IUuJFsa4KXmWw4,12126
|
|
81
82
|
optimum/rbln/transformers/models/audio_spectrogram_transformer/__init__.py,sha256=I2vL4lrzbT5p4eJcH-EKHzEfcPkj_XVsie7jb9q6yic,775
|
|
82
83
|
optimum/rbln/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py,sha256=z7LJiVJPmnlCM3mcyhPJP8AufSrxO_dsPeJ51onq-Nc,833
|
|
83
84
|
optimum/rbln/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py,sha256=FIKEVWpIt6-JQX9B_rAfCrAPqdUHtR2i8D_X2k7639E,1498
|
|
@@ -107,6 +108,9 @@ optimum/rbln/transformers/models/decoderonly/decoderonly_architecture.py,sha256=
|
|
|
107
108
|
optimum/rbln/transformers/models/decoderonly/decoderonly_runtime_utils.py,sha256=9acEQxGRzd21YkzxRchkhqxqpX7emQHZigFg60BIulc,19902
|
|
108
109
|
optimum/rbln/transformers/models/decoderonly/generation_decoderonly.py,sha256=4D89IF0yQju_Dp_vLJN_dBkpe2U_LMWaUciYx57D-0M,3379
|
|
109
110
|
optimum/rbln/transformers/models/decoderonly/modeling_decoderonly.py,sha256=hu2eJr0CpLHnRPSLhyBhyyC6DfosKmPu7lPjapcBCkE,33061
|
|
111
|
+
optimum/rbln/transformers/models/depth_anything/__init__.py,sha256=xvPSIriMJWyNeVYoVB1Z7YqB4kkHOIkaHq7loNps-dk,756
|
|
112
|
+
optimum/rbln/transformers/models/depth_anything/configuration_depth_anything.py,sha256=JujBVEUa_zZDXNPr1y-B_PhK5SgFFcY8Ib4EoGjjtmE,989
|
|
113
|
+
optimum/rbln/transformers/models/depth_anything/modeling_depth_anything.py,sha256=ganUtyPKcdKe5QCJ2atQhblzfAstyYkThYDm_DIecU8,1014
|
|
110
114
|
optimum/rbln/transformers/models/distilbert/__init__.py,sha256=zXL78SOEORTnUN_wrdoaDaYpntG8lcFHvPobM6jC0CI,841
|
|
111
115
|
optimum/rbln/transformers/models/distilbert/configuration_distilbert.py,sha256=O3BW9JjyYk9PLyiofvOKEgTdMZ_jpIuPfot281pSsyg,984
|
|
112
116
|
optimum/rbln/transformers/models/distilbert/modeling_distilbert.py,sha256=LUh6zYGa8AR3Yxaj3gtyJRc-czBN3qnHTc-JTAhuqY0,1099
|
|
@@ -226,7 +230,7 @@ optimum/rbln/utils/model_utils.py,sha256=4k5879Kh75m3x_vS4-qOGfqsOiAvc2kdNFFfvsF
|
|
|
226
230
|
optimum/rbln/utils/runtime_utils.py,sha256=R6uXDbeJP03-FWdd4vthNe2D4aCra5n12E3WB1ifiGM,7933
|
|
227
231
|
optimum/rbln/utils/save_utils.py,sha256=hG5uOtYmecSXZuGTvCXsTM-SiyZpr5q3InUGCCq_jzQ,3619
|
|
228
232
|
optimum/rbln/utils/submodule.py,sha256=w5mgPgncI740gVKMu3S-69DGNdUSI0bTZxegQGcZ98Y,5011
|
|
229
|
-
optimum_rbln-0.8.
|
|
230
|
-
optimum_rbln-0.8.
|
|
231
|
-
optimum_rbln-0.8.
|
|
232
|
-
optimum_rbln-0.8.
|
|
233
|
+
optimum_rbln-0.8.3a3.dist-info/METADATA,sha256=NmmTKyVMLYeulq_6EaNrsurXob_0dJ59oBbz1Eeh2VA,5299
|
|
234
|
+
optimum_rbln-0.8.3a3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
235
|
+
optimum_rbln-0.8.3a3.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
236
|
+
optimum_rbln-0.8.3a3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|