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

'jittor_core.Var' object has no attribute 'tile' #441

Closed
cyw3 opened this issue May 19, 2023 · 0 comments
Closed

'jittor_core.Var' object has no attribute 'tile' #441

cyw3 opened this issue May 19, 2023 · 0 comments

Comments

@cyw3
Copy link

cyw3 commented May 19, 2023

Describe the bug

A clear and concise description of what the bug is. 使用中文也可以。

当我调用 self.model.chat(self.tokenizer, question, history=history)遇到了下面异常

AttributeError: 'jittor_core.Var' object has no attribute 'tile'

相反,使用 self.model.stream_chat(self.tokenizer, question, history=history) 就没有问题。

Full Log

Provide a full log of Jittor execution, Jittor will log environment information which help us to locate your bugs. Provide a screenshot is also acceptable.

'jittor_core.Var' object has no attribute 'tile'
Traceback (most recent call last):
  File "/root/.pyenv/versions/3.10.0/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/root/.pyenv/versions/3.10.0/lib/python3.10/site-packages/knack/invocation.py", line 224, in execute
    cmd_result = parsed_args.func(params)
  File "/root/.pyenv/versions/3.10.0/lib/python3.10/site-packages/knack/commands.py", line 146, in __call__
    return self.handler(*args, **kwargs)
  File "/root/.pyenv/versions/3.10.0/lib/python3.10/site-packages/knack/commands.py", line 253, in _command_handler
    result = op(client, **command_args) if client else op(**command_args)
  File "/data/test/_ask.py", line 77, in _ask
    return model.ask(" ".join(question))
  File "/data/test/chatglm_6b/__init__.py", line 59, in ask
    return self.model.chat(self.tokenizer, question, history=history)
  File "/root/.pyenv/versions/3.10.0/lib/python3.10/site-packages/jittor/__init__.py", line 118, in inner
    ret = func(*args, **kw)
  File "/root/.cache/huggingface/modules/transformers_modules/chatglm_6b/modeling_chatglm.py", line 1285, in chat
    outputs = self.generate(**inputs, **gen_kwargs)
  File "/root/.pyenv/versions/3.10.0/lib/python3.10/site-packages/jittor/__init__.py", line 118, in inner
    ret = func(*args, **kw)
  File "/root/.pyenv/versions/3.10.0/lib/python3.10/site-packages/transformers/generation/utils.py", line 1565, in generate
    return self.sample(
  File "/root/.pyenv/versions/3.10.0/lib/python3.10/site-packages/transformers/generation/utils.py", line 2667, in sample
    next_tokens.tile(eos_token_id_tensor.shape[0], 1).ne(eos_token_id_tensor.unsqueeze(1)).prod(dim=0)
AttributeError: 'jittor_core.Var' object has no attribute 'tile'

Minimal Reproduce

Reproduce this error with a file or several lines of code.
If it is not possible, leave it blank.

tokenizer = AutoTokenizer.from_pretrained("/path/to/chatglm_6b", trust_remote_code=True)
model = AutoModel.from_pretrained("/path/to/chatglm_6b", trust_remote_code=True)
if jt.has_cuda:
    model.half().cuda()
else:
    model.float32()
    torch.half = torch.float
    torch.Tensor.half = torch.Tensor.float
model.eval()
model.chat(self.tokenizer, "question", history=list())

Expected behavior

A clear and concise description of what you expected to happen.

If you are submitting an issue for the first time, please refer to our guideline

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