CGCL-codes / Attack_PTMC

The dataset, source code and the results of our ESEC/FSE 2023 paper "An Extensive Study on Adversarial Attack against Pre-trained Models of Code".
MIT License
10 stars 1 forks source link

AttributeError: 'Dictionary' object has no attribute 'eos' #4

Closed chunkify closed 8 months ago

chunkify commented 8 months ago

Thanks for the interesting work.

I am facing some problems while trying to train the PLBART model on the clone detection dataset. I did not find sentencepiece.bpe.model in the replication package. I downloaded sentencepiece.bpe.model from the following link: https://github.com/wasiahmad/PLBART/blob/main/sentencepiece/sentencepiece.bpe.model

However, I got the error: AttributeError: 'Dictionary' object has no attribute 'eos'.

Could you please upload the sentencepiece.bpe.model or which sentencepiece.bpe.model you used while training the PLBART model?

xhdu commented 8 months ago

Thanks for your attention, I have added this file.

turtlepig2001 commented 4 months ago

Thanks for the interesting work.

I am facing some problems while trying to train the PLBART model on the clone detection dataset. I did not find sentencepiece.bpe.model in the replication package. I downloaded sentencepiece.bpe.model from the following link: https://github.com/wasiahmad/PLBART/blob/main/sentencepiece/sentencepiece.bpe.model

However, I got the error: AttributeError: 'Dictionary' object has no attribute 'eos'.

Could you please upload the sentencepiece.bpe.model or which sentencepiece.bpe.model you used while training the PLBART model?

i have the same error:*AttributeError: 'Dictionary' object has no attribute 'eos'。Have you solved this problem? Could you please tell me the version of fairseq you used?

chunkify commented 2 months ago

Thanks for the interesting work. I am facing some problems while trying to train the PLBART model on the clone detection dataset. I did not find sentencepiece.bpe.model in the replication package. I downloaded sentencepiece.bpe.model from the following link: https://github.com/wasiahmad/PLBART/blob/main/sentencepiece/sentencepiece.bpe.model However, I got the error: AttributeError: 'Dictionary' object has no attribute 'eos'. Could you please upload the sentencepiece.bpe.model or which sentencepiece.bpe.model you used while training the PLBART model?

i have the same error:*AttributeError: 'Dictionary' object has no attribute 'eos'。Have you solved this problem? Could you please tell me the version of fairseq you used?

Hi,

I solved the problem. It's related to the model checkpoint. You must have the exact model checkpoint to run the PLBART model on the clone detection dataset. You can download the checkpoint from the following link:

https://usaskca1-my.sharepoint.com/:u:/g/personal/mda439_usask_ca/EZrTseUNOu5Irs1sXQAquRwBuRCyjDE0UW7wYxx59ywCAQ?e=v5I2M0

If you have any problems downloading it, please let me know. I can share the model via email.

lsrhaha1 commented 2 months ago

Thanks for the interesting work. I am facing some problems while trying to train the PLBART model on the clone detection dataset. I did not find sentencepiece.bpe.model in the replication package. I downloaded sentencepiece.bpe.model from the following link: https://github.com/wasiahmad/PLBART/blob/main/sentencepiece/sentencepiece.bpe.model However, I got the error: AttributeError: 'Dictionary' object has no attribute 'eos'. Could you please upload the sentencepiece.bpe.model or which sentencepiece.bpe.model you used while training the PLBART model?

i have the same error:*AttributeError: 'Dictionary' object has no attribute 'eos'。Have you solved this problem? Could you please tell me the version of fairseq you used?

Hi,

I solved the problem. It's related to the model checkpoint. You must have the exact model checkpoint to run the PLBART model on the clone detection dataset. You can download the checkpoint from the following link:

https://usaskca1-my.sharepoint.com/:u:/g/personal/mda439_usask_ca/EZrTseUNOu5Irs1sXQAquRwBuRCyjDE0UW7wYxx59ywCAQ?e=v5I2M0

If you have any problems downloading it, please let me know. I can share the model via email.

Hi,

I have downloaded and used the file in your link, but I still have the same error, may I ask if you have changed anything else ?

chunkify commented 2 months ago

I did not change anything.


Awal

On Sat, Aug 10, 2024, 3:55 a.m. lsr_haha @.***> wrote:

Thanks for the interesting work. I am facing some problems while trying to train the PLBART model on the clone detection dataset. I did not find sentencepiece.bpe.model in the replication package. I downloaded sentencepiece.bpe.model from the following link: https://github.com/wasiahmad/PLBART/blob/main/sentencepiece/sentencepiece.bpe.model However, I got the error: AttributeError: 'Dictionary' object has no attribute 'eos'. Could you please upload the sentencepiece.bpe.model or which sentencepiece.bpe.model you used while training the PLBART model?

i have the same error:*AttributeError: 'Dictionary' object has no attribute 'eos'。Have you solved this problem? Could you please tell me the version of fairseq you used?

Hi,

I solved the problem. It's related to the model checkpoint. You must have the exact model checkpoint to run the PLBART model on the clone detection dataset. You can download the checkpoint from the following link:

https://usaskca1-my.sharepoint.com/:u:/g/personal/mda439_usask_ca/EZrTseUNOu5Irs1sXQAquRwBuRCyjDE0UW7wYxx59ywCAQ?e=v5I2M0

If you have any problems downloading it, please let me know. I can share the model via email.

Hi,

I have downloaded and used the file in your link, but I still have the same error, may I ask if you have changed anything else ?

— Reply to this email directly, view it on GitHub https://github.com/CGCL-codes/Attack_PTMC/issues/4#issuecomment-2280721265, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADVFH4WNVG7BE4BJX6C3HGDZQXPQFAVCNFSM6AAAAABJACIHM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBQG4ZDCMRWGU . You are receiving this because you authored the thread.Message ID: @.***>

lsrhaha1 commented 2 months ago

I did not change anything. ----- Awal On Sat, Aug 10, 2024, 3:55 a.m. lsr_haha @.> wrote: Thanks for the interesting work. I am facing some problems while trying to train the PLBART model on the clone detection dataset. I did not find sentencepiece.bpe.model in the replication package. I downloaded sentencepiece.bpe.model from the following link: https://github.com/wasiahmad/PLBART/blob/main/sentencepiece/sentencepiece.bpe.model However, I got the error: AttributeError: 'Dictionary' object has no attribute 'eos'*. Could you please upload the sentencepiece.bpe.model or which sentencepiece.bpe.model you used while training the PLBART model? i have the same error:AttributeError: 'Dictionary' object has no attribute 'eos'。Have you solved this problem? Could you please tell me the version of fairseq you used? Hi, I solved the problem. It's related to the model checkpoint. You must have the exact model checkpoint to run the PLBART model on the clone detection dataset. You can download the checkpoint from the following link: https://usaskca1-my.sharepoint.com/:u:/g/personal/mda439_usask_ca/EZrTseUNOu5Irs1sXQAquRwBuRCyjDE0UW7wYxx59ywCAQ?e=v5I2M0 If you have any problems downloading it, please let me know. I can share the model via email. Hi, I have downloaded and used the file in your link, but I still have the same error, may I ask if you have changed anything else ? — Reply to this email directly, view it on GitHub <#4 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADVFH4WNVG7BE4BJX6C3HGDZQXPQFAVCNFSM6AAAAABJACIHM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBQG4ZDCMRWGU . You are receiving this because you authored the thread.Message ID: @*.***>

Thank you very much for your reply. I have solved the problem. It is a version issue with fairseq, "eos" was added in version 0.12. This error can be avoided simply by lowering the version to 0.10.2

chunkify commented 2 months ago

That's a great news. My fairseq version was: fairseq==0.10.0, and it worked.

On Sun, Aug 11, 2024 at 3:15 AM lsr_haha @.***> wrote:

I did not change anything. … <#m-2024374568178553170> ----- Awal On Sat, Aug 10, 2024, 3:55 a.m. lsr_haha @.*> wrote: Thanks for the interesting work. I am facing some problems while trying to train the PLBART model on the clone detection dataset. I did not find sentencepiece.bpe.model in the replication package. I downloaded sentencepiece.bpe.model from the following link: https://github.com/wasiahmad/PLBART/blob/main/sentencepiece/sentencepiece.bpe.model https://github.com/wasiahmad/PLBART/blob/main/sentencepiece/sentencepiece.bpe.model However, I got the error: AttributeError: 'Dictionary' object has no attribute 'eos'. Could you please upload the sentencepiece.bpe.model or which sentencepiece.bpe.model you used while training the PLBART model? i have the same error:AttributeError: 'Dictionary' object has no attribute 'eos'。Have you solved this problem? Could you please tell me the version of fairseq you used? Hi, I solved the problem. It's related to the model checkpoint. You must have the exact model checkpoint to run the PLBART model on the clone detection dataset. You can download the checkpoint from the following link: https://usaskca1-my.sharepoint.com/:u:/g/personal/mda439_usask_ca/EZrTseUNOu5Irs1sXQAquRwBuRCyjDE0UW7wYxx59ywCAQ?e=v5I2M0 https://usaskca1-my.sharepoint.com/:u:/g/personal/mda439_usask_ca/EZrTseUNOu5Irs1sXQAquRwBuRCyjDE0UW7wYxx59ywCAQ?e=v5I2M0 If you have any problems downloading it, please let me know. I can share the model via email. Hi, I have downloaded and used the file in your link, but I still have the same error, may I ask if you have changed anything else ? — Reply to this email directly, view it on GitHub <#4 (comment) https://github.com/CGCL-codes/Attack_PTMC/issues/4#issuecomment-2280721265>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADVFH4WNVG7BE4BJX6C3HGDZQXPQFAVCNFSM6AAAAABJACIHM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBQG4ZDCMRWGU https://github.com/notifications/unsubscribe-auth/ADVFH4WNVG7BE4BJX6C3HGDZQXPQFAVCNFSM6AAAAABJACIHM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBQG4ZDCMRWGU . You are receiving this because you authored the thread.Message ID: @.>

Thank you very much for your reply. I have solved the problem. It is a version issue with fairseq, "eos" was added in version 0.12. This error can be avoided simply by lowering the version to 0.10.2

— Reply to this email directly, view it on GitHub https://github.com/CGCL-codes/Attack_PTMC/issues/4#issuecomment-2282688842, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADVFH4U7VAK56G3K54NOWALZQ4TSJAVCNFSM6AAAAABJACIHM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBSGY4DQOBUGI . You are receiving this because you authored the thread.Message ID: @.***>