Skip to content

Commit def3bdd

Browse files
Add Type Argument To Greedy Decoding (#858)
Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
1 parent 60c3035 commit def3bdd

File tree

1 file changed

+4
-1
lines changed
  • modules/custom_operations/user_ie_extensions/tokenizer/python/openvino_tokenizers

1 file changed

+4
-1
lines changed

modules/custom_operations/user_ie_extensions/tokenizer/python/openvino_tokenizers/utils.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,12 @@ def greedy_decoder(input) -> Model:
8686
return token_ids.output(0)
8787

8888

89-
def add_greedy_decoding(text_generation_model: Model, logits_output: str = LOGITS_OUTPUT_NAME) -> Model:
89+
def add_greedy_decoding(
90+
text_generation_model: Model, logits_output: str = LOGITS_OUTPUT_NAME, output_type: Type = Type.i64
91+
) -> Model:
9092
ppp = PrePostProcessor(text_generation_model)
9193
ppp.output(logits_output).postprocess().custom(greedy_decoder)
94+
ppp.output(logits_output).tensor().set_element_type(output_type)
9295
model = ppp.build()
9396
model.output(logits_output).tensor.set_names({TOKEN_IDS_OUTPUT_NAME})
9497
return model

0 commit comments

Comments
 (0)