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

Enhance cli_demo.py #360

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Enhance cli_demo.py #360

wants to merge 1 commit into from

Conversation

jinchihe
Copy link

Enhance cli_demo.py for following:

  1. update coding to gbk to avoid below error while running the script.
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xbb in position 0: invalid start byte
  1. Remove useless import such as import readline that will cause some compilation errors, although may be a problem with my environment, but this import is useless, just remove that to avoid the problem.
  2. Remove useless functions in the script to avoid confuse.

Testing with the PR changes, that's OK, the script works fine now with the update:

# python cli_demo.py
Explicitly passing a `revision` is encouraged when loading a model with custom code to ensure no malicious code has been contributed in a newer revision.
Explicitly passing a `revision` is encouraged when loading a configuration with custom code to ensure no malicious code has been contributed in a newer revision.
Explicitly passing a `revision` is encouraged when loading a model with custom code to ensure no malicious code has been contributed in a newer revision.
[2023-07-23 08:05:52,372] [INFO] [real_accelerator.py:110:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:08<00:00,  1.15s/it]
欢迎使用 ChatGLM2-6B 模型,输入内容即可进行对话,clear 清空对话历史,stop 终止程序

用户:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant