ColossalAI icon indicating copy to clipboard operation
ColossalAI copied to clipboard

[BUG]: when i use coloasslai to load the huggingface model "Salesforce/codegen-2B-mono", i get the error "AttributeError: _old_init is not found in the CodeGenAttention, please make sure that you have imported CodeGenAttention before entering the context."

Open lupingllp opened this issue 2 years ago • 3 comments

🐛 Describe the bug

when i use coloasslai to load the huggingface model "Salesforce/codegen-2B-mono":https://github.com/salesforce/CodeGen, i get the error "AttributeError: _old_init is not found in the CodeGenAttention, please make sure that you have imported CodeGenAttention before entering the context."

Environment

No response

lupingllp avatar Feb 28 '23 12:02 lupingllp

Have a similar issue with a ViT transformer. In my case at least, it seems to stem from using the Auto huggingface classes inside the context.

grafail avatar Feb 28 '23 19:02 grafail

Have a similar issue with a ViT transformer. In my case at least, it seems to stem from using the Auto huggingface classes inside the context.

Hi grafail, have you fixed the issue?

lupingllp avatar Mar 01 '23 02:03 lupingllp

Hi @lupingllp and @grafail Could you please provide more details about your issue? It's hard for us to follow/reproduce/fix it now. Thanks.

binmakeswell avatar Mar 03 '23 09:03 binmakeswell

Hi @lupingllp and @grafail , just as the bug hint, you need to import the CodeGenAttention class rather than only replace the model. We are also working at 'lazy init', which can reduce the corresponding work. Thanks.

binmakeswell avatar Mar 21 '23 07:03 binmakeswell

We have updated a lot. Please check the latest code. This issue was closed due to inactivity. Thanks.

binmakeswell avatar Apr 27 '23 07:04 binmakeswell