bdqnghi / infercode

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

AttributeError: 'InferCodeClient' object has no attribute 'ast_parser' #24

Open Avv22 opened 2 years ago

Avv22 commented 2 years ago

Hello,

During running your model on based on your sample below:

from infercode.client.infercode_client import InferCodeClient
import os
import logging
logging.basicConfig(level=logging.INFO)

# Change from -1 to 0 to enable GPU
os.environ['CUDA_VISIBLE_DEVICES'] = "-1"

infercode = InferCodeClient(language="c")
infercode.init_from_config()
vectors = infercode.encode(["for (i = 0; i < n; i++)", "struct book{ int num; char s[27]; }shu[1000];"])

I over multiple strings of codes and it was giving output and stopped accidently after some iterations:

AttributeError: 'InferCodeClient' object has no attribute 'ast_parser'

Can you help with this please?