Фи-3 не может справиться с японцами. Как я могу решить эту проблему?Python

Программы на Python
Anonymous
Фи-3 не может справиться с японцами. Как я могу решить эту проблему?

Сообщение Anonymous »

Мне нравится Phi-3, созданный Microsoft.
Я столкнулся с ошибкой onnxruntime_genai. onnxruntime_genai — это библиотека Phi-3.
Как решить эту проблему?

Код: Выделить всё

import onnxruntime_genai as og

list_error = [234, 170, 132, 233, 161, 147, 232, 146, 145, 174, 152, 183, 141, 188, 138, 148, 182, 178, 162, 236, 139, 231, 189, 187, 175, 235]

model = og.Model(".\Phi-3-mini-128k-instruct-onnx\cpu_and_mobile\cpu-int4-rtn-block-32")
tokenizer = og.Tokenizer(model)
tokenizer_stream = tokenizer.create_stream()

for new_token in list_error:
print(tokenizer_stream.decode(new_token), end='', flush=True)

Код: Выделить всё

---------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)
Cell In[49], line 2
1 for new_token in list_error:
----> 2     print(tokenizer_stream.decode(new_token), end='', flush=True)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe7 in position 0: unexpected end of data
В tokenizer_stream.decode произошла ошибка UnicodeDecodeError.
Но я не вижу исходный код onnxruntime_genai.

Подробнее здесь: https://stackoverflow.com/questions/783 ... this-issue

Вернуться в «Python»