Skip to content

Commit 0433a00

Browse files
Handles incompatible quantization mode for ReversibleEmbedding (#2435)
* Handles incompatible quantization mode for ReversibleEmbedding * fix grammar
1 parent e856a65 commit 0433a00

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

keras_hub/src/layers/modeling/reversible_embedding.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@ def abs_max_quantize(inputs, axis):
245245
inputs, axis=axis, to_numpy=True
246246
)
247247

248+
if mode != "int8":
249+
raise NotImplementedError(
250+
"Invalid quantization mode. Expected 'int8'. "
251+
f"Received: quantization_mode={mode}"
252+
)
253+
248254
embeddings_shape = (self.input_dim, self.output_dim)
249255
if mode == "int8":
250256
embeddings, embeddings_scale = abs_max_quantize(

0 commit comments

Comments
 (0)