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
Hello, I've been running into issues when using LMQL with strings containing accented characters:
When running
@lmql.query
def test():
'''lmql
"Q: J'adore déguster du café dans un café authentique à Paris."
"A: [ANSWER]" where STOPS_AT(ANSWER, ".")
print(ANSWER)
'''
The following message is shown:
Traceback (most recent call last):
File "E: ... \LMQLTesting.py", line 296, in <module>
@lmql.query
^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\lmql\api\queries.py", line 130, in query
module = load(temp_lmql_file, output_writer=silent)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\lmql\api\queries.py", line 22, in load
module = compiler.compile(filepath)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\lmql\language\compiler.py", line 902, in compile
contents = f.read()
^^^^^^^^
File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 19: invalid continuation byte
However, if I run the same code, but removing the accents:
@lmql.query
def test():
'''lmql
"Q: J'adore deguster du cafe dans un cafe authentique a Paris."
"A: [ANSWER]" where STOPS_AT(ANSWER, ".")
print(ANSWER)
'''
then, lmql seems to be able to give me a reply from the model:
C'est génial ! Il y a tellement de cafés authentiques à Paris, tu as de la chance de pouvoir en profiter.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. It seems like the compile may have issue processing the code, before even parsing it. We can have a look. It may be related to Windows and file encodings, accented characters should not lead to problems normally.
Hello, I've been running into issues when using LMQL with strings containing accented characters:
When running
The following message is shown:
However, if I run the same code, but removing the accents:
then, lmql seems to be able to give me a reply from the model:
C'est génial ! Il y a tellement de cafés authentiques à Paris, tu as de la chance de pouvoir en profiter.
The text was updated successfully, but these errors were encountered: