Comments (6)
Definitely was a user error on the above comment, but to fix the clang error all I did was open the code_tokenizer.py file and replace line 24 with this, save and exit. --> clang.cindex.Config.set_library_file('/usr/lib/x86_64-linux-gnu/libclang-6.0.so.1')
This worked for me and I was able to get some output.
from transcoder.
Tried both methods, still throwing this error:
`Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/clang/cindex.py", line 4129, in get_cindex_library
library = cdll.LoadLibrary(self.get_filename())
File "/usr/lib/python3.6/ctypes/init.py", line 426, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python3.6/ctypes/init.py", line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: /path/to/lib/clang/libclang-11.so/libclang.so: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "TransCoder/translate.py", line 24, in
import preprocessing.src.code_tokenizer as code_tokenizer
File "/content/TransCoder/preprocessing/src/code_tokenizer.py", line 29, in
idx = clang.cindex.Index.create()
File "/usr/local/lib/python3.6/dist-packages/clang/cindex.py", line 2666, in create
return Index(conf.lib.clang_createIndex(excludeDecls, 0))
File "/usr/local/lib/python3.6/dist-packages/clang/cindex.py", line 198, in get
value = self.wrapped(instance)
File "/usr/local/lib/python3.6/dist-packages/clang/cindex.py", line 4103, in lib
lib = self.get_cindex_library()
File "/usr/local/lib/python3.6/dist-packages/clang/cindex.py", line 4134, in get_cindex_library
raise LibclangError(msg)
clang.cindex.LibclangError: /path/to/lib/clang/libclang-11.so/libclang.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().`
from transcoder.
According to @brozi first commit if libclang-11.so
isn't located on /usr/lib/llvm-7/lib/
you must modify ./preprocessing/src/code_tokenizer.py
at line 24
from
clang.cindex.Config.set_library_path('/usr/lib/llvm-7/lib/')
To :
clang.cindex.Config.set_library_path("/path/to/lib/clang/libclang-11.so")
from transcoder.
I don't know if you managed to fix your problem but you can also try to downgrade the clang package to version 6.0.0.2 and then locate libclang.so if it is not in /usr/lib/llvm-7/lib/
pip install clang==6.0.0.2
from transcoder.
line 24
clang.cindex.Config.set_library_file('/usr/lib/x86_64-linux-gnu/libclang-6.0.so.1')
and Comment out line 30
#idx = clang.cindex.Index.create()
from transcoder.
This repo is now deprecated. Please now refer to our new repository https://github.com/facebookresearch/CodeGen, which solves this issue. Does not use clang anymore !
from transcoder.
Related Issues (20)
- What's <DOCUMENT_ID=\"{path}\"> for? HOT 2
- json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) HOT 1
- Data path (os.path.isdir(path) returning false when it exists) using FB XLM HOT 3
- bpe.cpp-java-python.with_comments only has vocab file HOT 2
- Multi-bleu.perl file not found HOT 3
- How to get parallel dataset from already shared raw tokenized data ? HOT 1
- Accessing COBOL programs using Google Big Query HOT 1
- Why Truncate Test and Validation Data
- Scores do not match with paper
- Showing error about transcoder
- Error on line43 for translation
- ablation on datasize
- How to getting word embedding from the trained model of TransCoder? HOT 5
- How to give a new input (cpp file or python file) in translate.py to translate it into other language?
- add online test
- RuntimeError: CUDA error: device-side assert triggered HOT 1
- AssertionError: failed to create symlink .....TransCoder/data/test_dataset/cpp-java-python.with_comments.XLM-syml/train.java.0.pth for file .../TransCoder/data/test_dataset/cpp-java-python.with_comments/java.train.with_comments.0.bpe.pth HOT 1
- ValueError: invalid literal for int() with base 10: '' HOT 1
- Does this model support training for code conversion in other languages
- Question about GeeksForGeeks valid and test set
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transcoder.