Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameters that support Chinese encoding. #1483

Open
ZQFORWARD opened this issue Nov 25, 2024 · 4 comments
Open

Add parameters that support Chinese encoding. #1483

ZQFORWARD opened this issue Nov 25, 2024 · 4 comments
Labels

Comments

@ZQFORWARD
Copy link

ZQFORWARD commented Nov 25, 2024

When I build an Agent using a tool and the tool returns Chinese characters, sometimes there may be encoding issues that prevent Chinese characters from being recognized correctly. I hope to add a parameter to solve the Chinese encoding problem.
For example, parameters such as: json.dumps (content, ensure_ascii=False).

@manthanguptaa
Copy link
Contributor

@ZQFORWARD that's an excellent suggestion. Would you like to work on it?

@ZQFORWARD
Copy link
Author

ZQFORWARD commented Nov 26, 2024

Of course, the relevant problem points have been identified through debugging. Just add one parameter and modify line 138 in the phi/model/ollama/tools.py file.
json.dumps ({"name": _fc_message. tool_name, "content": _fc_message.content}, ensure_ascii=False)
Chinese output could be correctly

@ysolanky
Copy link
Contributor

@ZQFORWARD Thanks for finding the fix! I am going to test this with OllamaTools and integrate this change

Copy link

This issue has been automatically marked as stale due to 14 days of inactivity and will now be closed.

@github-actions github-actions bot added the stale label Dec 16, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2024
@dirkbrnd dirkbrnd reopened this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants