mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #12483] feat: Endpoint may support more file format #32148
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EthantLu on GitHub (Apr 5, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12483
Check Existing Issues
Problem Description
When I uplode image with endpoint API, the problem occurred:
File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/text.py", line 43, in lazy_load
text = f.read()
│ └ <method 'read' of '_io.TextIOWrapper' objects>
└ <_io.TextIOWrapper name='/app/backend/data/uploads/7c7f82be-dda3-47b1-9c11-19a0cb8a2d4a_2.png' mode='r' encoding='UTF-8'>
File "", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/threading.py", line 1002, in _bootstrap
self._bootstrap_inner()
│ └ <function Thread._bootstrap_inner at 0x7fb641c64860>
└ <WorkerThread(AnyIO worker thread, started 140419765601984)>
File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
│ └ <function WorkerThread.run at 0x7fb60cbe8540>
└ <WorkerThread(AnyIO worker thread, started 140419765601984)>
File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 962, in run
result = context.run(func, *args)
│ │ │ └ ()
│ │ └ functools.partial(<function upload_file at 0x7fb61858c680>, user=UserModel(id='5670136a-7b47-4cd2-831c-7f2364dec134', name='E...
│ └ <method 'run' of '_contextvars.Context' objects>
└ <_contextvars.Context object at 0x7fb60b372440>
File "/app/backend/open_webui/routers/files.py", line 85, in upload_file
process_file(request, ProcessFileForm(file_id=id), user=user)
│ │ │ │ └ UserModel(id='5670136a-7b47-4cd2-831c-7f2364dec134', name='EthanLu', email='mail@lutong.space', role='admin', profile_image_u...
│ │ │ └ '7c7f82be-dda3-47b1-9c11-19a0cb8a2d4a'
│ │ └ <class 'open_webui.routers.retrieval.ProcessFileForm'>
│ └ <starlette.requests.Request object at 0x7fb60b3d2a10>
└ <function process_file at 0x7fb6152198a0>
Desired Solution you'd like
I intend to utilize the endpoint API for image uploads to leverage Open WebUI's image compression feature, thereby reducing token usage. However, I have discovered that the endpoint API does not support image uploads.
Alternatives Considered
No response
Additional Context
No response