Unable to support Chinese input #430

Closed
opened 2025-11-11 14:21:06 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @freefer on GitHub (Mar 7, 2024).

image

Originally created by @freefer on GitHub (Mar 7, 2024). ![image](https://github.com/open-webui/open-webui/assets/9861446/82458e80-6495-4732-969c-7404f2768319)
Author
Owner

@freefer commented on GitHub (Mar 7, 2024):

2024-03-07 11:52:52 INFO: 172.17.0.1:53560 - "GET /api/v1/chats/ HTTP/1.1" 200 OK
2024-03-07 11:52:52 http://host.docker.internal:11434
2024-03-07 11:52:52 {"model":"gemma:latest","messages":[{"role":"user","content":"hellow"},{"role":"assistant","content":""}],"options":{},"stream":true}
2024-03-07 11:52:52 INFO: 172.17.0.1:53560 - "POST /ollama/api/chat HTTP/1.1" 200 OK
2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "POST /api/v1/chats/fd65bd23-3113-4c25-b3f9-64edd1dc2e9a HTTP/1.1" 200 OK
2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "GET /api/v1/chats/ HTTP/1.1" 200 OK
2024-03-07 11:52:53 http://host.docker.internal:11434
2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "POST /ollama/api/generate HTTP/1.1" 200 OK
2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "POST /api/v1/chats/fd65bd23-3113-4c25-b3f9-64edd1dc2e9a HTTP/1.1" 200 OK
2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "GET /api/v1/chats/ HTTP/1.1" 200 OK
2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "GET /api/v1/chats/ HTTP/1.1" 200 OK
2024-03-07 11:53:07 http://host.docker.internal:11434
2024-03-07 11:53:07 {"model":"gemma:latest","messages":[{"role":"user","content":"hellow"},{"role":"assistant","content":"Hello, how are you?\n\nI'm an AI language model, here to help you with your queries. Would you like me to tell you more about myself or answer a question?"},{"role":"user","content":"介绍一下JavaScript"},{"role":"assistant","content":""}],"options":{},"stream":true}
2024-03-07 11:53:07 INFO: 172.17.0.1:54364 - "POST /ollama/api/chat HTTP/1.1" 500 Internal Server Error
2024-03-07 11:53:07 INFO: 172.17.0.1:54364 - "GET /api/v1/chats/ HTTP/1.1" 200 OK

@freefer commented on GitHub (Mar 7, 2024): 2024-03-07 11:52:52 INFO: 172.17.0.1:53560 - "GET /api/v1/chats/ HTTP/1.1" 200 OK 2024-03-07 11:52:52 http://host.docker.internal:11434 2024-03-07 11:52:52 {"model":"gemma:latest","messages":[{"role":"user","content":"hellow"},{"role":"assistant","content":""}],"options":{},"stream":true} 2024-03-07 11:52:52 INFO: 172.17.0.1:53560 - "POST /ollama/api/chat HTTP/1.1" 200 OK 2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "POST /api/v1/chats/fd65bd23-3113-4c25-b3f9-64edd1dc2e9a HTTP/1.1" 200 OK 2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "GET /api/v1/chats/ HTTP/1.1" 200 OK 2024-03-07 11:52:53 http://host.docker.internal:11434 2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "POST /ollama/api/generate HTTP/1.1" 200 OK 2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "POST /api/v1/chats/fd65bd23-3113-4c25-b3f9-64edd1dc2e9a HTTP/1.1" 200 OK 2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "GET /api/v1/chats/ HTTP/1.1" 200 OK 2024-03-07 11:52:53 INFO: 172.17.0.1:53560 - "GET /api/v1/chats/ HTTP/1.1" 200 OK 2024-03-07 11:53:07 http://host.docker.internal:11434 2024-03-07 11:53:07 {"model":"gemma:latest","messages":[{"role":"user","content":"hellow"},{"role":"assistant","content":"Hello, how are you?\n\nI'm an AI language model, here to help you with your queries. Would you like me to tell you more about myself or answer a question?"},{"role":"user","content":"介绍一下JavaScript"},{"role":"assistant","content":""}],"options":{},"stream":true} 2024-03-07 11:53:07 INFO: 172.17.0.1:54364 - "POST /ollama/api/chat HTTP/1.1" 500 Internal Server Error 2024-03-07 11:53:07 INFO: 172.17.0.1:54364 - "GET /api/v1/chats/ HTTP/1.1" 200 OK
Author
Owner

@freefer commented on GitHub (Mar 7, 2024):

image

@freefer commented on GitHub (Mar 7, 2024): ![image](https://github.com/open-webui/open-webui/assets/9861446/e07151e9-7b64-4726-862e-074d006f99cb)
Author
Owner

@wanderingmeow commented on GitHub (Mar 7, 2024):

This commit removed the use of \x encoding for Unicode characters in the JSON body passed to the requests.request() function call: f04d60b6d9

Before:
b'{"model":"****","messages":[{"role":"user","content":"\xe4\xbd\xa0\xe5\xa5\xbd"},{"role":"assistant","content":""}],"options":{}}'

After this commit:
'{"model":"****","messages":[{"role":"user","content":"你好"},{"role":"assistant","content":""}],"options":{}}'

@wanderingmeow commented on GitHub (Mar 7, 2024): This commit removed the use of `\x` encoding for Unicode characters in the JSON body passed to the `requests.request()` function call: https://github.com/open-webui/open-webui/commit/f04d60b6d954ee4e68805240f19ea044028e4dba Before: `b'{"model":"****","messages":[{"role":"user","content":"\xe4\xbd\xa0\xe5\xa5\xbd"},{"role":"assistant","content":""}],"options":{}}'` After this commit: `'{"model":"****","messages":[{"role":"user","content":"你好"},{"role":"assistant","content":""}],"options":{}}'`
Author
Owner

@tjbck commented on GitHub (Mar 7, 2024):

The latest version should fix the issue, please let us know if the issue persists! Thanks!

@tjbck commented on GitHub (Mar 7, 2024): The latest version should fix the issue, please let us know if the issue persists! Thanks!
Author
Owner

@YuanfengZhang commented on GitHub (Mar 18, 2024):

It works well now and this thread shall be closed 👍

@YuanfengZhang commented on GitHub (Mar 18, 2024): It works well now and this thread shall be closed 👍
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#430