You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following comparison in multinomial_causal_lm sample as CustomStreamer sample Python code does not make sense. It never match because two string (text[-3:] and chr(65533)) lengths do not match.
It looks like that elif text[-1] == chr(65533): is enough to detect � (U+FFFD: replacement character) for this case in Python.
The text was updated successfully, but these errors were encountered:
e87tn95h
changed the title
CustomStreamer sample will print replacement character �
CustomStreamer sample can print replacement character �
Dec 13, 2024
@e87tn95h you are right. Without much consideration we copied logic from c++ here, but it was wrong and you are right. � is 3 bytes long, but len('�') == 1. Thanks for noticing this!
I don't have PR, also I won't be able to make PR for this project as speedy as you.
If this shared idea is good for you and your project, please feel free taking it (and then close this issue).
The following comparison in multinomial_causal_lm sample as CustomStreamer sample Python code does not make sense. It never match because two string (
text[-3:]
andchr(65533)
) lengths do not match.openvino.genai/samples/python/multinomial_causal_lm/multinomial_causal_lm.py
Lines 93 to 95 in d17f716
It looks like that
elif text[-1] == chr(65533):
is enough to detect � (U+FFFD: replacement character) for this case in Python.The text was updated successfully, but these errors were encountered: