-
Notifications
You must be signed in to change notification settings - Fork 425
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
AttributeError: 'str' object has no attribute 'shape' #516
Comments
You can refer the issue here #517 , add a simple |
Why I can't modify the code? Every time I make changes and run it, the code reverts back to its original state. |
Remove the python cache may work? |
thanks,i will try it. choose the version of 4.36.2 may also works |
Set the specific version is the optimal solution 👀 |
System Info / 系統信息
Google Colab A100 Cuda
Who can help? / 谁可以帮助到您?
I am using the script in https://huggingface.co/THUDM/cogvlm-base-224-hf but I get this error:
~/.cache/huggingface/modules/transformers_modules/THUDM/cogvlm-base-224-hf/cf0930a30d930c4ad0de393726385591a0271567/modeling_cogvlm.py in llm_forward(self, input_ids, token_type_ids, attention_mask, position_ids, past_key_values, inputs_embeds, use_cache, output_attentions, output_hidden_states, return_dict)
439
440 if past_key_values is not None:
--> 441 past_key_values_length = past_key_values[0][0].shape[2]
442 seq_length_with_past = seq_length_with_past + past_key_values_length
443
AttributeError: 'str' object has no attribute 'shape'
Information / 问题信息
Reproduction / 复现过程
I ran the script from both THUDM/cogvlm-chat-hf as well as THUDM/cogvlm-base-224-hf with several different formats of images but always get the same error. I double checked that the inputs are all of the right expected type.
Expected behavior / 期待表现
2 weeks ago, when I ran the script, I did not get this error. Instead it'd generate a valid word/sentence output.
The text was updated successfully, but these errors were encountered: