bdqnghi / infercode

[ICSE 2021] - InferCode: Self-Supervised Learning of Code Representations by Predicting Subtrees

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'InferCodeClient' object has no attribute 'ast_parser'

sqhan-Husky opened this issue · comments

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?

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)?

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.

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?

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.

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