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

chat添加stop参数后出现 slice() cannot be applied to a 0-dim tensor. #23

Closed
zhaodice opened this issue Apr 23, 2023 · 2 comments
Closed

Comments

@zhaodice
Copy link

File "/home/user/git/hcgf/test2/./webui.py", line 97, in predict
    response, history = gl.chat(inp=input, history=history, max_len=max_length,stop=['<eop>'])
  File "/home/user/anaconda3/envs/glm-finetune/lib/python3.10/site-packages/hcgf/sft/lora_ft.py", line 250, in chat
    custom_stop_tensor_list = create_token_tensor_list(
  File "/home/user/anaconda3/envs/glm-finetune/lib/python3.10/site-packages/hcgf/utils/utils.py", line 60, in create_token_tensor_list
    tids = tokenizer(
IndexError: slice() cannot be applied to a 0-dim tensor.
@zhaodice
Copy link
Author

换成 stop=['<'] 也是一样的

@hscspring
Copy link
Owner

这些特殊的不需要添加进去。

hscspring pushed a commit that referenced this issue May 13, 2023
hscspring pushed a commit that referenced this issue May 13, 2023
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

No branches or pull requests

2 participants