getomni-ai / zerox

PDF to Markdown with vision models
https://getomni.ai/ocr-demo
MIT License
6.58k stars 358 forks source link

'gbk' codec can't encode #86

Closed YYH211 closed 2 weeks ago

YYH211 commented 2 weeks ago

Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm 2024.2.4\plugins\python\helpers-pro\pydevd_asyncio\pydevd_nest_asyncio.py", line 138, in run return loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\JetBrains\PyCharm 2024.2.4\plugins\python\helpers-pro\pydevd_asyncio\pydevd_nest_asyncio.py", line 243, in run_until_complete return f.result() ^^^^^^^^^^ File "C:\Users\22891\anaconda3\envs\zerox\Lib\asyncio\futures.py", line 203, in result raise self._exception.with_traceback(self._exception_tb) File "C:\Users\22891\anaconda3\envs\zerox\Lib\asyncio\tasks.py", line 277, in __step result = coro.send(None) ^^^^^^^^^^^^^^^ File "C:\Users\22891\Desktop\zerox-main\zerox-main\test_zerox.py", line 73, in main result = await zerox(file_path=file_path, model=model, output_dir=output_dir, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\22891\Desktop\zerox-main\zerox-main\py_zerox\pyzerox\core\zerox.py", line 169, in zerox await f.write("\n\n".join(aggregated_markdown)) File "C:\Users\22891\anaconda3\envs\zerox\Lib\site-packages\aiofiles\threadpool\utils.py", line 43, in method return await self._loop.run_in_executor(self._executor, cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\22891\anaconda3\envs\zerox\Lib\asyncio\futures.py", line 287, in await yield self # This tells Task to wait for completion. ^^^^^^^^^^ File "C:\Users\22891\anaconda3\envs\zerox\Lib\asyncio\tasks.py", line 349, in __wakeup future.result() File "C:\Users\22891\anaconda3\envs\zerox\Lib\asyncio\futures.py", line 203, in result raise self._exception.with_traceback(self._exception_tb) File "C:\Users\22891\anaconda3\envs\zerox\Lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeEncodeError: 'gbk' codec can't encode character '\u223c' in position 1140: illegal multibyte sequence

How can i solve this problem?