bdqnghi / infercode

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

TypeError: Argument to set_language must be a Language #11

Closed lrongzheni closed 3 years ago

lrongzheni commented 3 years ago

python test.py 2021-08-29 16:16:20.939654: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 WARNING:tensorflow:From /data/anaconda3/envs/infercode/lib/python3.8/site-packages/tensorflow/python/compat/v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. Instructions for updating: non-resource variables are not supported in the long term Traceback (most recent call last): File "test.py", line 10, in infercode.init_from_config() File "/data/anaconda3/envs/infercode/lib/python3.8/site-packages/infercode/client/infercode_client.py", line 29, in init_from_config self.init_utils() File "/data/anaconda3/envs/infercode/lib/python3.8/site-packages/infercode/client/base_client.py", line 112, in init_utils self.ast_parser = ASTParser(self.language) File "/data/anaconda3/envs/infercode/lib/python3.8/site-packages/infercode/data_utils/ast_parser.py", line 81, in init self.parser.set_language(lang) TypeError: Argument to set_language must be a Language

lrongzheni commented 3 years ago

What's the problem,README is ok for the instance?

bdqnghi commented 3 years ago

can you try the lastest version, which is 0.0.22 for now? Also, please check if the current version of tree-sitter is also the latest, which is 0.19.0, you can try: pip3 install tree-sitter==0.19.0

lrongzheni commented 3 years ago

Thanks, fIxed it.

Avv22 commented 1 year ago

Thank you very much. It worked. Should we pass the source code with escape characters at the end of each line of a code or just copy and past the code without them please?