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

[Bug]:Workstation does not support Chinese characters? #513

Open
nUser0 opened this issue Jan 10, 2025 · 4 comments · May be fixed by #517
Open

[Bug]:Workstation does not support Chinese characters? #513

nUser0 opened this issue Jan 10, 2025 · 4 comments · May be fixed by #517
Assignees
Labels
bug Something isn't working

Comments

@nUser0
Copy link

nUser0 commented Jan 10, 2025

Workstation bug:
When I fill in Chinese characters in the content of the message or the system prompt of the agent in the workflow, an error message appears:

SyntaxError: Non-UTF-8 code starting with '\xc4' in file C:\Users\Lenovo\AppData\Local\Temp\tmpw0lirvil.py on line 31, but no encoding declared; see https://peps.python.org/pep-0263/ for details

In fact, in the Grop Chat example, the system prompt of angents already contains a few Chinese characters - single quotation marks. I need to change them before it can start.

@nUser0 nUser0 added the bug Something isn't working label Jan 10, 2025
@rayrayraykk
Copy link
Collaborator

Thank you for your feedback. To help us identify the issue, could you please specify which feature and version of Workstation you were using when you encountered the problem? For example, were you using the "Export Python Code" feature, running JSON/Python as Gradio, or another function? This information will assist us in addressing the bug more effectively.

@nUser0
Copy link
Author

nUser0 commented Jan 10, 2025

When I press the "run this workflow" button, the terminal show the SyntaxError.
Version is the latest version.

@rayrayraykk
Copy link
Collaborator

The code works fine on macOS, but I suggest including a specific modification in the Python code for improved cross-platform compatibility. You can enhance the script by modifying the following lines in AgentScope/src/agentscope/web/workstation/workflow_dag (lines 150-154):

# Combine header and body to form the full script
script = (
    "# -*- coding: utf-8 -*-\n"
    f"{header}\n\n\n{main_body}\n\nif __name__ == "
    f"'__main__':\n    main()\n"
)

We will update the code base for win support, thanks for your feedback.

@nUser0
Copy link
Author

nUser0 commented Jan 16, 2025

There's no problem now. Thanks you!

@rayrayraykk rayrayraykk linked a pull request Jan 17, 2025 that will close this issue
4 tasks
@rayrayraykk rayrayraykk self-assigned this Jan 17, 2025
@rayrayraykk rayrayraykk linked a pull request Jan 17, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants