martysai/source-code-summarization

TransCoder: test on translation data

Closed this issue · 1 comments

Consider TransCoder README to run evaluation for a natural language.

Command to run:

python translate.py --src_lang cpp --tgt_lang python --model_path models/model_2.pth < input_code.cpp

Error:

OSError: /usr/lib/llvm-7/lib//libclang-11.so: cannot open shared object file: No such file or directory

The problem is in finding the location of libclang.so file in local conda environment.

Probable fix:

clang.cindex.LibclangError: /usr/lib/llvm-7/lib//libclang-11.so: cannot open shared object file: No such file or directory. To provide a path to libclang use Config.set_library_path() or Config.set_library_file().

Fixed with installing the package:

conda install -c conda-forge libclang-cpp

Then changing code_tokenizer.py path:

clang.cindex.Config.set_library_path('/home/marat/anaconda3/envs/transcoder/lib/')