-
Notifications
You must be signed in to change notification settings - Fork 145
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
basic_demo/cli_demo.py _issue #171
Comments
同时也试过更换图片,尝试不同输入文本等方法 |
Exact same problem here. |
同样的问题 |
same issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
System Info / 系統信息
系统信息
Linux version 5.15.0-112-generic (buildd@lcy02-amd64-051) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38)
环境信息
Who can help? / 谁可以帮助到您?
@zr
Information / 问题信息
Reproduction / 复现过程
运行basic_demo/cli__demo.py
Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████| 8/8 [00:06<00:00, 1.17it/s]
image path >>>>> /share/home/wangyufeng/pangye/cogVLM2/CogVLM2/basic_demo/demo.jpg
Human: (NOTHING HERE)
(得到结果)
Traceback (most recent call last):
File "/share/home/wangyufeng/pangye/cogVLM2/CogVLM2/basic_demo/cli_demo.py", line 102, in
outputs = model.generate(**inputs, **gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/share/home/wangyufeng/miniconda3/envs/CogVLM2/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/share/home/wangyufeng/miniconda3/envs/CogVLM2/lib/python3.12/site-packages/transformers/generation/utils.py", line 1989, in generate
result = self._sample(
^^^^^^^^^^^^^
File "/share/home/wangyufeng/miniconda3/envs/CogVLM2/lib/python3.12/site-packages/transformers/generation/utils.py", line 2932, in _sample
outputs = self(**model_inputs, return_dict=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/share/home/wangyufeng/miniconda3/envs/CogVLM2/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/share/home/wangyufeng/miniconda3/envs/CogVLM2/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/share/home/wangyufeng/.cache/huggingface/modules/transformers_modules/cogvlm2-llama3-chat-19B/modeling_cogvlm.py", line 649, in forward
outputs = self.model(
^^^^^^^^^^^
File "/share/home/wangyufeng/miniconda3/envs/CogVLM2/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/share/home/wangyufeng/miniconda3/envs/CogVLM2/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/share/home/wangyufeng/.cache/huggingface/modules/transformers_modules/cogvlm2-llama3-chat-19B/modeling_cogvlm.py", line 403, in forward
return self.llm_forward(
^^^^^^^^^^^^^^^^^
File "/share/home/wangyufeng/.cache/huggingface/modules/transformers_modules/cogvlm2-llama3-chat-19B/modeling_cogvlm.py", line 452, in llm_forward
past_key_values_length = past_key_values[0][0].shape[2]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'shape'
Expected behavior / 期待表现
正常产出结果,输入文本后应当得到正确的结果
The text was updated successfully, but these errors were encountered: