bdqnghi / infercode

[ICSE 2021] - InferCode: Self-Supervised Learning of Code Representations by Predicting Subtrees
89 stars 24 forks source link

'InferCodeClient' object has no attribute 'ast_parser' #14

Closed sqhan-Husky closed 3 years ago

sqhan-Husky commented 3 years ago

l have tried 'InferCodeClient' successfully to generate vectors for c-language with your hints in the Readme file. However, when l want to change the language to java by 'InferCodeClient(language="java")', the encode function meet an error.

image

Can the Infercode as Pypi package support other languages except for c now?

bdqnghi commented 3 years ago

hi, i have just had a checked, the code is working normally with java parser, can you make sure that you are using the latest version (0.0.27)?

sqhan-Husky commented 3 years ago

Thanks for your reply. I notice that the key is the line 'infercode.init_from_config()'. If l first run the function on c-language InferCodeClient in a jupyter notebook and then run a new-created java InferCodeClient, it get an unexpected problem. image image image So l just ignore this line and get the previous error.

If I run it in a new notebook, it can work normally.

sqhan-Husky commented 3 years ago

By the way, I'm interested in your project and the main paper and want to research your model in detail. Is the source code in 'old_version' folder in accordance with your developed Pypi package?

bdqnghi commented 3 years ago

The "old_version" is obsolete, i'm not actively maintaining it anymore, the source code in "infercode" is the one in accordance with the Pypi.

sqhan-Husky commented 3 years ago

OK, I will try it. Thanks for sharing your code with the public!