keras-hub-nightly 0.23.0.dev202508300415__py3-none-any.whl → 0.23.0.dev202509130423__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.
- keras_hub/src/layers/modeling/reversible_embedding.py +2 -1
- keras_hub/src/models/backbone.py +2 -1
- keras_hub/src/models/causal_lm.py +11 -0
- keras_hub/src/models/gemma/gemma_presets.py +8 -0
- keras_hub/src/models/gemma3/gemma3_attention.py +48 -0
- keras_hub/src/models/gemma3/gemma3_backbone.py +4 -0
- keras_hub/src/models/gemma3/gemma3_decoder_block.py +12 -0
- keras_hub/src/models/sam/sam_prompt_encoder.py +3 -1
- keras_hub/src/samplers/beam_sampler.py +6 -6
- keras_hub/src/samplers/sampler.py +8 -6
- keras_hub/src/utils/openvino_utils.py +141 -0
- keras_hub/src/version.py +1 -1
- {keras_hub_nightly-0.23.0.dev202508300415.dist-info → keras_hub_nightly-0.23.0.dev202509130423.dist-info}/METADATA +1 -1
- {keras_hub_nightly-0.23.0.dev202508300415.dist-info → keras_hub_nightly-0.23.0.dev202509130423.dist-info}/RECORD +16 -15
- {keras_hub_nightly-0.23.0.dev202508300415.dist-info → keras_hub_nightly-0.23.0.dev202509130423.dist-info}/WHEEL +0 -0
- {keras_hub_nightly-0.23.0.dev202508300415.dist-info → keras_hub_nightly-0.23.0.dev202509130423.dist-info}/top_level.txt +0 -0
@@ -235,7 +235,8 @@ class ReversibleEmbedding(keras.layers.Embedding):
|
|
235
235
|
|
236
236
|
return super()._int8_call(inputs)
|
237
237
|
|
238
|
-
def quantize(self, mode, type_check=True):
|
238
|
+
def quantize(self, mode, type_check=True, config=None):
|
239
|
+
del config
|
239
240
|
if type_check and type(self) is not ReversibleEmbedding:
|
240
241
|
raise self._not_implemented_error(self.quantize)
|
241
242
|
|
keras_hub/src/models/backbone.py
CHANGED
@@ -130,7 +130,8 @@ class Backbone(keras.Model):
|
|
130
130
|
1. a built-in preset identifier like `'bert_base_en'`
|
131
131
|
2. a Kaggle Models handle like `'kaggle://user/bert/keras/bert_base_en'`
|
132
132
|
3. a Hugging Face handle like `'hf://user/bert_base_en'`
|
133
|
-
4. a
|
133
|
+
4. a ModelScope handle like `'modelscope://user/bert_base_en'`
|
134
|
+
5. a path to a local preset directory like `'./bert_base_en'`
|
134
135
|
|
135
136
|
This constructor can be called in one of two ways. Either from the base
|
136
137
|
class like `keras_hub.models.Backbone.from_preset()`, or from
|
@@ -132,6 +132,17 @@ class CausalLM(Task):
|
|
132
132
|
return self.generate_function
|
133
133
|
|
134
134
|
self.generate_function = self.generate_step
|
135
|
+
if keras.config.backend() == "openvino":
|
136
|
+
from keras_hub.src.utils.openvino_utils import ov_infer
|
137
|
+
|
138
|
+
def wrapped_generate_function(inputs, stop_token_ids=None):
|
139
|
+
# Convert to numpy for OpenVINO backend
|
140
|
+
inputs = tree.map_structure(ops.array, inputs)
|
141
|
+
return ov_infer(
|
142
|
+
self, inputs, stop_token_ids, self.generate_step
|
143
|
+
)
|
144
|
+
|
145
|
+
self.generate_function = wrapped_generate_function
|
135
146
|
if keras.config.backend() == "torch":
|
136
147
|
import torch
|
137
148
|
|
@@ -198,4 +198,12 @@ backbone_presets = {
|
|
198
198
|
},
|
199
199
|
"kaggle_handle": "kaggle://google/shieldgemma/keras/shieldgemma_27b_en/2",
|
200
200
|
},
|
201
|
+
"vault_gemma_1b_en": {
|
202
|
+
"metadata": {
|
203
|
+
"description": "1 billion parameter, 26-layer, VaultGemma model.",
|
204
|
+
"params": 1038741120,
|
205
|
+
"path": "gemma",
|
206
|
+
},
|
207
|
+
"kaggle_handle": "kaggle://keras/vaultgemma/keras/vault_gemma_1b_en/2",
|
208
|
+
},
|
201
209
|
}
|
@@ -46,6 +46,7 @@ class CachedGemma3Attention(keras.layers.Layer):
|
|
46
46
|
layer_norm_epsilon=1e-6,
|
47
47
|
rope_wavelength=10_000.0,
|
48
48
|
rope_scaling_factor=1.0,
|
49
|
+
use_bidirectional_attention=False,
|
49
50
|
dropout=0,
|
50
51
|
**kwargs,
|
51
52
|
):
|
@@ -61,6 +62,7 @@ class CachedGemma3Attention(keras.layers.Layer):
|
|
61
62
|
self.layer_norm_epsilon = layer_norm_epsilon
|
62
63
|
self.rope_wavelength = rope_wavelength
|
63
64
|
self.rope_scaling_factor = rope_scaling_factor
|
65
|
+
self.use_bidirectional_attention = use_bidirectional_attention
|
64
66
|
self.dropout = dropout
|
65
67
|
|
66
68
|
self._kernel_initializer = keras.initializers.get(
|
@@ -240,12 +242,58 @@ class CachedGemma3Attention(keras.layers.Layer):
|
|
240
242
|
results = ops.einsum("bkgts,bskh->btkgh", attention_softmax, v)
|
241
243
|
return ops.reshape(results, (b, q_len, self.num_query_heads, h))
|
242
244
|
|
245
|
+
def _compute_bidirectional_sliding_mask(self, batch_size, sequence_length):
|
246
|
+
"""Computes a bidirectional sliding window attention mask.
|
247
|
+
|
248
|
+
A token can attend to any other token if their absolute distance is
|
249
|
+
within half the sliding window size. This mask is used in embedding
|
250
|
+
models like `EmbeddingGemma`.
|
251
|
+
|
252
|
+
Args:
|
253
|
+
batch_size: The batch size for the mask.
|
254
|
+
sequence_length: The length of the sequence.
|
255
|
+
|
256
|
+
Returns:
|
257
|
+
A boolean attention mask with shape
|
258
|
+
`(batch_size, sequence_length, sequence_length)`.
|
259
|
+
"""
|
260
|
+
i = keras.ops.expand_dims(
|
261
|
+
keras.ops.arange(sequence_length, dtype="int32"), axis=1
|
262
|
+
)
|
263
|
+
j = keras.ops.arange(sequence_length, dtype="int32")
|
264
|
+
|
265
|
+
# If sliding window size is 4, the token in question attends to 1
|
266
|
+
# token before and 2 tokens after.
|
267
|
+
w_right = self.sliding_window_size // 2
|
268
|
+
w_left = self.sliding_window_size - w_right - 1
|
269
|
+
|
270
|
+
# Calculate the relative distance.
|
271
|
+
distance = i - j
|
272
|
+
|
273
|
+
mask = keras.ops.logical_and(distance <= w_left, distance >= -w_right)
|
274
|
+
|
275
|
+
mask = keras.ops.expand_dims(mask, axis=0)
|
276
|
+
return keras.ops.broadcast_to(
|
277
|
+
mask, (batch_size, sequence_length, sequence_length)
|
278
|
+
)
|
279
|
+
|
243
280
|
def _mask_sliding_window(
|
244
281
|
self,
|
245
282
|
attention_mask,
|
246
283
|
cache_update_index=0,
|
247
284
|
):
|
248
285
|
batch_size, query_len, key_len = ops.shape(attention_mask)
|
286
|
+
|
287
|
+
if self.use_bidirectional_attention:
|
288
|
+
bidirectional_sliding_mask = (
|
289
|
+
self._compute_bidirectional_sliding_mask(
|
290
|
+
batch_size=batch_size,
|
291
|
+
# `query_len = key_len` for embedding models
|
292
|
+
sequence_length=query_len,
|
293
|
+
)
|
294
|
+
)
|
295
|
+
return ops.logical_and(attention_mask, bidirectional_sliding_mask)
|
296
|
+
|
249
297
|
# Compute the sliding window for square attention.
|
250
298
|
all_ones = ops.ones((key_len, key_len), "bool")
|
251
299
|
if keras.config.backend() == "tensorflow":
|
@@ -196,6 +196,7 @@ class Gemma3Backbone(Backbone):
|
|
196
196
|
global_rope_scaling_factor=1.0,
|
197
197
|
vision_encoder=None,
|
198
198
|
layer_norm_epsilon=1e-6,
|
199
|
+
use_bidirectional_attention=False,
|
199
200
|
dropout=0,
|
200
201
|
dtype=None,
|
201
202
|
**kwargs,
|
@@ -251,6 +252,7 @@ class Gemma3Backbone(Backbone):
|
|
251
252
|
sliding_window_size=sliding_window_size,
|
252
253
|
rope_wavelength=rope_wavelength,
|
253
254
|
rope_scaling_factor=rope_scaling_factor,
|
255
|
+
use_bidirectional_attention=use_bidirectional_attention,
|
254
256
|
dropout=dropout,
|
255
257
|
dtype=dtype,
|
256
258
|
name=f"decoder_block_{i}",
|
@@ -357,6 +359,7 @@ class Gemma3Backbone(Backbone):
|
|
357
359
|
self.sliding_window_size = sliding_window_size
|
358
360
|
self.local_rope_scaling_factor = local_rope_scaling_factor
|
359
361
|
self.global_rope_scaling_factor = global_rope_scaling_factor
|
362
|
+
self.use_bidirectional_attention = use_bidirectional_attention
|
360
363
|
self.layer_norm_epsilon = layer_norm_epsilon
|
361
364
|
self.dropout = dropout
|
362
365
|
|
@@ -396,6 +399,7 @@ class Gemma3Backbone(Backbone):
|
|
396
399
|
"vision_encoder": None
|
397
400
|
if self.vision_encoder is None
|
398
401
|
else keras.layers.serialize(self.vision_encoder),
|
402
|
+
"use_bidirectional_attention": self.use_bidirectional_attention,
|
399
403
|
"layer_norm_epsilon": self.layer_norm_epsilon,
|
400
404
|
"dropout": self.dropout,
|
401
405
|
}
|
@@ -45,6 +45,7 @@ class Gemma3DecoderBlock(keras.layers.Layer):
|
|
45
45
|
layer_norm_epsilon=1e-6,
|
46
46
|
rope_wavelength=10_000.0,
|
47
47
|
rope_scaling_factor=1.0,
|
48
|
+
use_bidirectional_attention=False,
|
48
49
|
dropout=0,
|
49
50
|
**kwargs,
|
50
51
|
):
|
@@ -66,6 +67,7 @@ class Gemma3DecoderBlock(keras.layers.Layer):
|
|
66
67
|
self.layer_norm_epsilon = layer_norm_epsilon
|
67
68
|
self.rope_wavelength = rope_wavelength
|
68
69
|
self.rope_scaling_factor = rope_scaling_factor
|
70
|
+
self.use_bidirectional_attention = use_bidirectional_attention
|
69
71
|
self.dropout = dropout
|
70
72
|
|
71
73
|
self.pre_attention_norm = RMSNormalization(
|
@@ -93,6 +95,7 @@ class Gemma3DecoderBlock(keras.layers.Layer):
|
|
93
95
|
rope_wavelength=rope_wavelength,
|
94
96
|
rope_scaling_factor=rope_scaling_factor,
|
95
97
|
dropout=dropout,
|
98
|
+
use_bidirectional_attention=use_bidirectional_attention,
|
96
99
|
dtype=self.dtype_policy,
|
97
100
|
name="attention",
|
98
101
|
)
|
@@ -209,6 +212,14 @@ class Gemma3DecoderBlock(keras.layers.Layer):
|
|
209
212
|
if cache is not None:
|
210
213
|
input_length = ops.shape(cache)[2]
|
211
214
|
|
215
|
+
if self.use_bidirectional_attention:
|
216
|
+
# `output_length` and `input_length` will be the same in this case
|
217
|
+
# because we use bidirectional attention for models like
|
218
|
+
# `EmbeddingGemma` which aren't used for text generation.
|
219
|
+
mask_1 = decoder_mask
|
220
|
+
mask_2 = ops.transpose(mask_1, (0, 2, 1))
|
221
|
+
return mask_1 * mask_2
|
222
|
+
|
212
223
|
causal_mask = compute_causal_mask(
|
213
224
|
batch_size=batch_size,
|
214
225
|
input_length=input_length,
|
@@ -304,6 +315,7 @@ class Gemma3DecoderBlock(keras.layers.Layer):
|
|
304
315
|
"dropout": self.dropout,
|
305
316
|
"rope_wavelength": self.rope_wavelength,
|
306
317
|
"rope_scaling_factor": self.rope_scaling_factor,
|
318
|
+
"use_bidirectional_attention": self.use_bidirectional_attention,
|
307
319
|
}
|
308
320
|
)
|
309
321
|
return config
|
@@ -67,7 +67,9 @@ class SAMPromptEncoder(keras.layers.Layer):
|
|
67
67
|
self.activation = activation
|
68
68
|
|
69
69
|
self.positional_embedding_layer = RandomFrequencyPositionalEmbeddings(
|
70
|
-
num_positional_features=self.hidden_size // 2,
|
70
|
+
num_positional_features=self.hidden_size // 2,
|
71
|
+
scale=1,
|
72
|
+
dtype=self.dtype,
|
71
73
|
)
|
72
74
|
|
73
75
|
self.foreground_point_embed = keras.layers.Embedding(
|
@@ -95,15 +95,15 @@ class BeamSampler(Sampler):
|
|
95
95
|
)
|
96
96
|
log_probs = flatten_beams(ops.repeat(log_probs, batch_size, axis=0))
|
97
97
|
|
98
|
-
def cond(prompt, cache, index, log_probs):
|
98
|
+
def cond(prompt, cache, index, mask, log_probs):
|
99
99
|
if stop_token_ids is None:
|
100
|
-
return True
|
100
|
+
return ops.convert_to_tensor(True, dtype="bool")
|
101
101
|
# Stop if all sequences have produced a *new* stop token.
|
102
102
|
end_tokens = any_equal(prompt, stop_token_ids, ~mask)
|
103
103
|
prompt_done = ops.any(end_tokens, axis=-1)
|
104
104
|
return ops.logical_not(ops.all(prompt_done))
|
105
105
|
|
106
|
-
def body(prompt, cache, index, log_probs):
|
106
|
+
def body(prompt, cache, index, mask, log_probs):
|
107
107
|
# Compute the softmax distribution for the next token.
|
108
108
|
logits, _, cache = next(prompt, cache, index)
|
109
109
|
vocab_size = ops.shape(logits)[-1]
|
@@ -150,12 +150,12 @@ class BeamSampler(Sampler):
|
|
150
150
|
next_token = next_token[:, None]
|
151
151
|
prompt = ops.slice_update(prompt, [0, index], next_token)
|
152
152
|
# Return the iteration of the loop state.
|
153
|
-
return (prompt, cache, index + 1, log_probs)
|
153
|
+
return (prompt, cache, index + 1, mask, log_probs)
|
154
154
|
|
155
|
-
prompt, _, _, log_probs = self.run_loop(
|
155
|
+
prompt, _, _, _, log_probs = self.run_loop(
|
156
156
|
cond=cond,
|
157
157
|
body=body,
|
158
|
-
loop_vars=(prompt, cache, index, log_probs),
|
158
|
+
loop_vars=(prompt, cache, index, mask, log_probs),
|
159
159
|
maximum_iterations=(max_length - index),
|
160
160
|
model=model,
|
161
161
|
)
|
@@ -92,16 +92,18 @@ class Sampler:
|
|
92
92
|
# `ops.while_loop` will not accept `None` as a value for `loop_vars`.
|
93
93
|
cache = () if cache is None else cache
|
94
94
|
|
95
|
-
|
95
|
+
# OpenVINO requires all parameters to be passed in the body.
|
96
|
+
# So we pass `mask` as well.
|
97
|
+
def cond(prompt, cache, index, mask):
|
96
98
|
if stop_token_ids is None:
|
97
|
-
return True
|
99
|
+
return ops.convert_to_tensor(True, dtype="bool")
|
98
100
|
# Stop if all sequences have produced a *new* id from
|
99
101
|
# stop_token_ids.
|
100
102
|
end_tokens = any_equal(prompt, stop_token_ids, ~mask)
|
101
103
|
prompt_done = ops.any(end_tokens, axis=-1)
|
102
104
|
return ops.logical_not(ops.all(prompt_done))
|
103
105
|
|
104
|
-
def body(prompt, cache, index):
|
106
|
+
def body(prompt, cache, index, mask):
|
105
107
|
# Compute the softmax distribution for the next token.
|
106
108
|
logits, _, cache = next(prompt, cache, index)
|
107
109
|
probabilities = self.compute_probabilities(logits)
|
@@ -115,12 +117,12 @@ class Sampler:
|
|
115
117
|
prompt = ops.slice_update(prompt, [0, index], next_token)
|
116
118
|
|
117
119
|
# Return the next prompt, cache and incremented index.
|
118
|
-
return (prompt, cache, index + 1)
|
120
|
+
return (prompt, cache, index + 1, mask)
|
119
121
|
|
120
|
-
prompt, _, _ = self.run_loop(
|
122
|
+
prompt, _, _, _ = self.run_loop(
|
121
123
|
cond,
|
122
124
|
body,
|
123
|
-
loop_vars=(prompt, cache, index),
|
125
|
+
loop_vars=(prompt, cache, index, mask),
|
124
126
|
maximum_iterations=(max_length - index),
|
125
127
|
model=model,
|
126
128
|
)
|
@@ -0,0 +1,141 @@
|
|
1
|
+
from keras import tree
|
2
|
+
|
3
|
+
from keras_hub.src.utils.keras_utils import print_msg
|
4
|
+
|
5
|
+
try:
|
6
|
+
import openvino as ov
|
7
|
+
import openvino.opset14 as ov_opset
|
8
|
+
from openvino import Core
|
9
|
+
except ImportError:
|
10
|
+
ov = None
|
11
|
+
ov_opset = None
|
12
|
+
Core = None
|
13
|
+
|
14
|
+
|
15
|
+
_core = None
|
16
|
+
|
17
|
+
|
18
|
+
def get_core():
|
19
|
+
"""Get or create OpenVINO Core instance.
|
20
|
+
|
21
|
+
Returns:
|
22
|
+
openvino.Core: OpenVINO Core instance,
|
23
|
+
or None if OpenVINO not available.
|
24
|
+
"""
|
25
|
+
global _core
|
26
|
+
if _core is None and Core is not None:
|
27
|
+
_core = Core()
|
28
|
+
return _core
|
29
|
+
|
30
|
+
|
31
|
+
def get_device():
|
32
|
+
"""Detect and return the best available OpenVINO device.
|
33
|
+
|
34
|
+
Returns:
|
35
|
+
str: "GPU" if available, otherwise "CPU".
|
36
|
+
"""
|
37
|
+
core = get_core()
|
38
|
+
if core is None:
|
39
|
+
return "CPU"
|
40
|
+
return "GPU" if "GPU" in core.available_devices else "CPU"
|
41
|
+
|
42
|
+
|
43
|
+
def compile_model(struct_params, struct_outputs, device, model_dtype):
|
44
|
+
"""Compile OpenVINO model with dynamic shapes and precision hints.
|
45
|
+
|
46
|
+
Args:
|
47
|
+
struct_params: Model parameters structure.
|
48
|
+
struct_outputs: Model outputs structure.
|
49
|
+
device: Target device ("GPU" or "CPU").
|
50
|
+
model_dtype: Model precision ("f16" or "f32").
|
51
|
+
|
52
|
+
Returns:
|
53
|
+
Compiled OpenVINO model ready for inference.
|
54
|
+
"""
|
55
|
+
flat_params = tree.flatten(struct_params)
|
56
|
+
flat_outputs = tree.flatten(struct_outputs)
|
57
|
+
parameters = [p.output.get_node() for p in flat_params]
|
58
|
+
results = [ov_opset.result(r.output) for r in flat_outputs]
|
59
|
+
ov_model = ov.Model(results=results, parameters=parameters)
|
60
|
+
for ov_input in ov_model.inputs:
|
61
|
+
rank = ov_input.get_partial_shape().rank.get_length()
|
62
|
+
ov_input.get_node().set_partial_shape(ov.PartialShape([-1] * rank))
|
63
|
+
ov_model.validate_nodes_and_infer_types()
|
64
|
+
config = {"INFERENCE_PRECISION_HINT": model_dtype}
|
65
|
+
core = get_core()
|
66
|
+
if core is None:
|
67
|
+
raise RuntimeError("OpenVINO not available")
|
68
|
+
return core.compile_model(ov_model, device, config)
|
69
|
+
|
70
|
+
|
71
|
+
def get_outputs(inputs, struct_outputs, compiled_ov_model, unpack_singleton):
|
72
|
+
"""Execute compiled OpenVINO model and return structured outputs.
|
73
|
+
|
74
|
+
Args:
|
75
|
+
inputs: Input tensors for inference.
|
76
|
+
struct_outputs: Expected output structure.
|
77
|
+
compiled_ov_model: Compiled OpenVINO model.
|
78
|
+
unpack_singleton: Function to unpack singleton outputs.
|
79
|
+
|
80
|
+
Returns:
|
81
|
+
Structured model outputs matching expected format.
|
82
|
+
"""
|
83
|
+
flatten_inputs = tree.flatten(inputs)
|
84
|
+
raw = compiled_ov_model(flatten_inputs).to_tuple()
|
85
|
+
packed = tree.pack_sequence_as(struct_outputs, raw)
|
86
|
+
return unpack_singleton(packed)
|
87
|
+
|
88
|
+
|
89
|
+
def ov_infer(model, inputs, stop_token_ids, fn):
|
90
|
+
"""High-level OpenVINO inference with model reuse and compilation.
|
91
|
+
|
92
|
+
This function manages OpenVINO model compilation and caching. It reuses
|
93
|
+
existing compiled models when possible, or compiles new ones as needed.
|
94
|
+
Handles device detection and automatic precision selection.
|
95
|
+
|
96
|
+
Args:
|
97
|
+
model: Keras model with OpenVINO backend support.
|
98
|
+
inputs: Input tensors for inference.
|
99
|
+
stop_token_ids: Token IDs that should stop generation.
|
100
|
+
fn: Function to execute with the parameterized inputs.
|
101
|
+
|
102
|
+
Returns:
|
103
|
+
Model outputs from OpenVINO inference.
|
104
|
+
"""
|
105
|
+
device = get_device()
|
106
|
+
|
107
|
+
# Try to use existing compiled model for the same device
|
108
|
+
if (
|
109
|
+
getattr(model, "ov_compiled_model", None) is not None
|
110
|
+
and getattr(model, "ov_device", None) is not None
|
111
|
+
and device == model.ov_device
|
112
|
+
):
|
113
|
+
try:
|
114
|
+
return get_outputs(
|
115
|
+
inputs,
|
116
|
+
model.struct_outputs,
|
117
|
+
model.ov_compiled_model,
|
118
|
+
model._unpack_singleton,
|
119
|
+
)
|
120
|
+
except RuntimeError as e:
|
121
|
+
print_msg(
|
122
|
+
"WARNING: OpenVINO inference \033[1mFAILED\033[0m, "
|
123
|
+
"recompiling model and trying again.\n" + str(e)
|
124
|
+
)
|
125
|
+
model.ov_compiled_model = None
|
126
|
+
model.struct_outputs = None
|
127
|
+
|
128
|
+
# Compile a new model
|
129
|
+
struct_params = model._parameterize_data(inputs)
|
130
|
+
model.struct_outputs = fn(struct_params, stop_token_ids)
|
131
|
+
model.ov_device = device
|
132
|
+
model_dtype = "f16" if model.dtype in ("float16", "bfloat16") else "f32"
|
133
|
+
model.ov_compiled_model = compile_model(
|
134
|
+
struct_params, model.struct_outputs, device, model_dtype
|
135
|
+
)
|
136
|
+
return get_outputs(
|
137
|
+
inputs,
|
138
|
+
model.struct_outputs,
|
139
|
+
model.ov_compiled_model,
|
140
|
+
model._unpack_singleton,
|
141
|
+
)
|
keras_hub/src/version.py
CHANGED
@@ -5,7 +5,7 @@ keras_hub/models/__init__.py,sha256=Est6LugIjoAFkpTgqZWfISk-1NVMH_k-4soHCHaMmyM,
|
|
5
5
|
keras_hub/samplers/__init__.py,sha256=aFQIkiqbZpi8vjrPp2MVII4QUfE-eQjra5fMeHsoy7k,886
|
6
6
|
keras_hub/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
keras_hub/src/api_export.py,sha256=9pQZK27JObxWZ96QPLBp1OBsjWigh1iuV6RglPGMRk0,1499
|
8
|
-
keras_hub/src/version.py,sha256=
|
8
|
+
keras_hub/src/version.py,sha256=eqYeQ2hIf5CtkVBmEaDZw5ncu2zXdHv8kPYEuZcqjJw,222
|
9
9
|
keras_hub/src/layers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
keras_hub/src/layers/modeling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
keras_hub/src/layers/modeling/alibi_bias.py,sha256=1XBTHI52L_iJDhN_w5ydu_iMhCuTgQAxEPwcLA6BPuk,4411
|
@@ -16,7 +16,7 @@ keras_hub/src/layers/modeling/f_net_encoder.py,sha256=zkVeO5Nk_kBZCUGq2LeDGmPEIM
|
|
16
16
|
keras_hub/src/layers/modeling/masked_lm_head.py,sha256=no6XQb76KB2cUiksYC0MSdyeDOK7pn8MY6cmdCDxpKs,9015
|
17
17
|
keras_hub/src/layers/modeling/non_max_supression.py,sha256=yAkAH1CCj_tYXgQTav39IRr_Uxn8hmzJgIxqbYQyZY8,22565
|
18
18
|
keras_hub/src/layers/modeling/position_embedding.py,sha256=vqmmUbMU-41Ns6qwR_4N1IvVsV0arGlkiTD7D7NMS2s,4562
|
19
|
-
keras_hub/src/layers/modeling/reversible_embedding.py,sha256=
|
19
|
+
keras_hub/src/layers/modeling/reversible_embedding.py,sha256=aBruxDo3nHWUpQxcS2kSLUGhV_obUPKpZKXv281AzzQ,10898
|
20
20
|
keras_hub/src/layers/modeling/rms_normalization.py,sha256=Ylnc9vkDw1A_ZqiKpQ09jVTAGumS5rspjdQOkH-mxf4,1084
|
21
21
|
keras_hub/src/layers/modeling/rotary_embedding.py,sha256=uKcEyidierqdEs67QYPMQrJ1u0gxqJYT22_YGnhkQ-I,6546
|
22
22
|
keras_hub/src/layers/modeling/sine_position_encoding.py,sha256=aLoadvQW1eeivac8gzymP740NXppblZ2C_OlErLMfN4,4063
|
@@ -43,8 +43,8 @@ keras_hub/src/metrics/rouge_n.py,sha256=JoFtmgjF4Ic263ny6bfD6vMHKreH9le3HnOOxemu
|
|
43
43
|
keras_hub/src/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
44
44
|
keras_hub/src/models/audio_to_text.py,sha256=XoOjXtKBX6K1fz-zOXcdVo3FpjuxCMnJZh2LQcYXb_0,2726
|
45
45
|
keras_hub/src/models/audio_to_text_preprocessor.py,sha256=GS-WWyJ6aSsPRxi_0bxvxA00h2mT2FEwSdAoQXAUYVI,3249
|
46
|
-
keras_hub/src/models/backbone.py,sha256=
|
47
|
-
keras_hub/src/models/causal_lm.py,sha256=
|
46
|
+
keras_hub/src/models/backbone.py,sha256=BdqPsne7lIITIxn6jY6AN4vZ-Rc9VnpqTxvVNR3CS7M,12210
|
47
|
+
keras_hub/src/models/causal_lm.py,sha256=FHGpbyFrDrnPSv5eRLfDgcpvjS6jDhSokMRl-kuumyg,18164
|
48
48
|
keras_hub/src/models/causal_lm_preprocessor.py,sha256=nxl-sfmCfkfl6JmVRASa878QbaZUgWSA6Jdu48x4-dY,7155
|
49
49
|
keras_hub/src/models/feature_pyramid_backbone.py,sha256=clEW-TTQSVJ_5qFNdDF0iABkin1p_xlBUFjJrC7T0IA,2247
|
50
50
|
keras_hub/src/models/image_classifier.py,sha256=yt6cjhPfqs8A_eWXBsXdXFzn-aRgH2rVHUq7Zu7CyK8,7804
|
@@ -225,15 +225,15 @@ keras_hub/src/models/gemma/gemma_backbone.py,sha256=GzAUSArw_pN9dtWQzTVhWDbW-XyW
|
|
225
225
|
keras_hub/src/models/gemma/gemma_causal_lm.py,sha256=3OXaIXlrKqMIuUnBk-bUz-0SYFL-XkkQTWm8qRY2YII,16770
|
226
226
|
keras_hub/src/models/gemma/gemma_causal_lm_preprocessor.py,sha256=bpKkEurWIfa6Kp9s4pz84-sBDSA6ZFNHP8nXG1fFQrg,2912
|
227
227
|
keras_hub/src/models/gemma/gemma_decoder_block.py,sha256=f5UsRO-VNsKJfm_WHVJWK4UahhzYm3sKprJ8jjr-zm4,7628
|
228
|
-
keras_hub/src/models/gemma/gemma_presets.py,sha256=
|
228
|
+
keras_hub/src/models/gemma/gemma_presets.py,sha256=6Okl8USxHhp8EvVebNgo7JDkO527fx0aHdcRy9WNm9k,7467
|
229
229
|
keras_hub/src/models/gemma/gemma_tokenizer.py,sha256=FhcyNL4lo63MqOhTQPFr07-u3BddL0fVM4TmOm8ku-I,2622
|
230
230
|
keras_hub/src/models/gemma/rms_normalization.py,sha256=fku-JEo2sNy-ytX7ySD1sRzdhRAPmYex_z8oFk1NiG8,833
|
231
231
|
keras_hub/src/models/gemma3/__init__.py,sha256=oPFadkdK5DRLD6sYx83iTetY5daWuSzmJilLjokHcbU,257
|
232
|
-
keras_hub/src/models/gemma3/gemma3_attention.py,sha256=
|
233
|
-
keras_hub/src/models/gemma3/gemma3_backbone.py,sha256=
|
232
|
+
keras_hub/src/models/gemma3/gemma3_attention.py,sha256=u3RNI8dva5lzzqFNTAe9996s87cNJ_GEWc9BIJD337Q,15473
|
233
|
+
keras_hub/src/models/gemma3/gemma3_backbone.py,sha256=pjCEg-T9ZiP7KTL7XpwM6vKwhcqhke2TCKpTURWJklg,16713
|
234
234
|
keras_hub/src/models/gemma3/gemma3_causal_lm.py,sha256=U3C9TWlIz8VefAxQ0wJ6bDz18wqHBie8B26Ub_nFZs4,13843
|
235
235
|
keras_hub/src/models/gemma3/gemma3_causal_lm_preprocessor.py,sha256=vjt4N-zr0Eb5kvkOR-WUgskDTNe64L_6tYnhyNb6xaE,29601
|
236
|
-
keras_hub/src/models/gemma3/gemma3_decoder_block.py,sha256=
|
236
|
+
keras_hub/src/models/gemma3/gemma3_decoder_block.py,sha256=CYwYazqwakLNfhOLBl_8Q2TVZcMcOxMtiZtuVlk_hoo,11470
|
237
237
|
keras_hub/src/models/gemma3/gemma3_image_converter.py,sha256=czi5JrTyKiK0nFzvonviBIX8jjvLHqvGNA9RyheB31k,536
|
238
238
|
keras_hub/src/models/gemma3/gemma3_interleave_embeddings.py,sha256=CfYdudk5En9iU6vEnrcrEWIztloD1r8VzF2extqAhAM,4616
|
239
239
|
keras_hub/src/models/gemma3/gemma3_presets.py,sha256=FGAHYE4HTLuiceuiCKBJtc1aNd7OgMB59KD0s6Ba_Fg,6105
|
@@ -421,7 +421,7 @@ keras_hub/src/models/sam/sam_image_segmenter_preprocessor.py,sha256=7slvyhGoMHmS
|
|
421
421
|
keras_hub/src/models/sam/sam_layers.py,sha256=dNyTlTHnnjnr-J9T06V1loZJsfrgfySWemn2CKEGa-Q,13902
|
422
422
|
keras_hub/src/models/sam/sam_mask_decoder.py,sha256=9RfjoNL7GSY6I9LZ3ulUa5cIoYSPJNP4KnHvq16lnM4,9549
|
423
423
|
keras_hub/src/models/sam/sam_presets.py,sha256=PVaWbFk5obdeh42pvW2_VqaieADOmKsbTU_X1Wp3sF8,875
|
424
|
-
keras_hub/src/models/sam/sam_prompt_encoder.py,sha256
|
424
|
+
keras_hub/src/models/sam/sam_prompt_encoder.py,sha256=sUj7po6DmobKwHQzKm4BNp_p5TJZj-ik4_FUV0K6smw,11877
|
425
425
|
keras_hub/src/models/sam/sam_transformer.py,sha256=8Bfj6FP691djsSZrvH_dgo6llARlS7ReU-zoqsrHPvQ,5742
|
426
426
|
keras_hub/src/models/segformer/__init__.py,sha256=ERgxA8tyeG2l4G6ywHisn6Oo0Iu7_9OAkzrC9TEFHSE,365
|
427
427
|
keras_hub/src/models/segformer/segformer_backbone.py,sha256=T61WQ50T6IwSeiK1NfUKJu3eqbj_m5gz9cpUPtqMfcc,5666
|
@@ -514,11 +514,11 @@ keras_hub/src/models/xlnet/xlnet_backbone.py,sha256=cZVNzu1lPxCBme9cvhHSbgbDnX58
|
|
514
514
|
keras_hub/src/models/xlnet/xlnet_content_and_query_embedding.py,sha256=QOYdbQBJ8mRQA1qFhj4JeHpzUToySYohe-oByxcFQaU,3942
|
515
515
|
keras_hub/src/models/xlnet/xlnet_encoder.py,sha256=VQEjNWG8CBGbZXQEmT2gx-6NOFXtmMOyRmw0Rs-Y6C0,12757
|
516
516
|
keras_hub/src/samplers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
517
|
-
keras_hub/src/samplers/beam_sampler.py,sha256=
|
517
|
+
keras_hub/src/samplers/beam_sampler.py,sha256=JPb4X0Yuog4kk1vdq3kWst3bj-yN_dxcBL79xHCxdPY,7246
|
518
518
|
keras_hub/src/samplers/contrastive_sampler.py,sha256=od69XNguQdgYpfhVjf5vc8BLhXiZ4QVmoSyd2ku_yWY,8304
|
519
519
|
keras_hub/src/samplers/greedy_sampler.py,sha256=Ldu2-KRLFKeeCSlOP29d9JvQnRW_S4w_GQijP8dhRdw,958
|
520
520
|
keras_hub/src/samplers/random_sampler.py,sha256=nQw2ldO0dwRFcz8SIC9xMty0CGc4m6DlAmNZEXMsdAg,1709
|
521
|
-
keras_hub/src/samplers/sampler.py,sha256=
|
521
|
+
keras_hub/src/samplers/sampler.py,sha256=vxlryQ4c6zyBbRw39-LRWZYg0HX-4czfiMWy7dcL1d0,8253
|
522
522
|
keras_hub/src/samplers/serialization.py,sha256=K6FC4AY1sfOLLIk2k4G783XWnQ_Rk3z1QrO97cZimNw,2770
|
523
523
|
keras_hub/src/samplers/top_k_sampler.py,sha256=WSyrhmOCan55X2JYAnNWE88rkx66sXqdoerl87nOrDQ,2250
|
524
524
|
keras_hub/src/samplers/top_p_sampler.py,sha256=9r29WdqBlrW_2TBma6QqkRps2Uit4a6iZPmq1Gsiuko,3400
|
@@ -536,6 +536,7 @@ keras_hub/src/tokenizers/word_piece_tokenizer.py,sha256=vP6AZgbzsRiuPCt3W_n94nsF
|
|
536
536
|
keras_hub/src/tokenizers/word_piece_tokenizer_trainer.py,sha256=cylrs02ZrYQ1TuZr9oyS3NrVbDwGctA3VXbIh1pFJMQ,6743
|
537
537
|
keras_hub/src/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
538
538
|
keras_hub/src/utils/keras_utils.py,sha256=IWsbg-p-XVLuOkba8PAYNf9zDo4G2RkINLr58p12MhA,5291
|
539
|
+
keras_hub/src/utils/openvino_utils.py,sha256=P1ZvedLv91LZD-UAgAo2dy6WC5305elh1qvgmdYQIGc,4512
|
539
540
|
keras_hub/src/utils/pipeline_model.py,sha256=jgzB6NQPSl0KOu08N-TazfOnXnUJbZjH2EXXhx25Ftg,9084
|
540
541
|
keras_hub/src/utils/preset_utils.py,sha256=vSs7U9cy0p6UqOEyGvudzL-o3mxl3FX22r4XH6rOgMg,37309
|
541
542
|
keras_hub/src/utils/python_utils.py,sha256=N8nWeO3san4YnGkffRXG3Ix7VEIMTKSN21FX5TuL7G8,202
|
@@ -577,7 +578,7 @@ keras_hub/src/utils/transformers/export/gemma.py,sha256=xX_vfQwvFZ_-lQX4kgMNOGKL
|
|
577
578
|
keras_hub/src/utils/transformers/export/hf_exporter.py,sha256=Qk52c6LIA2eMHUNY9Vy4STJSpnhLMdJ_t-3ljqhSr4k,5081
|
578
579
|
keras_hub/tokenizers/__init__.py,sha256=YEr_cwyX6MACxQOgyRwETilOFYBXpQLNXH22ZdSSv3o,4450
|
579
580
|
keras_hub/utils/__init__.py,sha256=jXPqVGBpJr_PpYmqD8aDG-fRMlxH-ulqCR2SZMn288Y,646
|
580
|
-
keras_hub_nightly-0.23.0.
|
581
|
-
keras_hub_nightly-0.23.0.
|
582
|
-
keras_hub_nightly-0.23.0.
|
583
|
-
keras_hub_nightly-0.23.0.
|
581
|
+
keras_hub_nightly-0.23.0.dev202509130423.dist-info/METADATA,sha256=7fzoPNWF1RdmuSoUw9VYdxtH1sSm5tTyxUT5UQAl9_g,7395
|
582
|
+
keras_hub_nightly-0.23.0.dev202509130423.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
583
|
+
keras_hub_nightly-0.23.0.dev202509130423.dist-info/top_level.txt,sha256=N4J6piIWBKa38A4uV-CnIopnOEf8mHAbkNXafXm_CuA,10
|
584
|
+
keras_hub_nightly-0.23.0.dev202509130423.dist-info/RECORD,,
|
File without changes
|