marella / ctransformers

Python bindings for the Transformer models implemented in C/C++ using GGML library.
MIT License
1.82k stars 138 forks source link

Can I run ctransformers on linux? I guess it gives error for GLIBC version. #152

Closed AayushSameerShah closed 1 year ago

AayushSameerShah commented 1 year ago

I am using: 5.4.0-1103-aws (Ubuntu 18.04)

When I try to import the model:

llm = AutoModelForCausalLM.from_pretrained(
    os.path.abspath(r"/home/ubuntu/Llama_SQL/codellama-7b-instruct.Q2_K.gguf"),
    model_type="llama",
    context_length=512,
    #config=config,
)

Gives this error:

Traceback (most recent call last):
  File "run_llama.py", line 8, in <module>
    llm = AutoModelForCausalLM.from_pretrained(
  File "/home/ubuntu/Llama_SQL/llama/lib/python3.8/site-packages/ctransformers/hub.py", line 175, in from_pretrained
    llm = LLM(
  File "/home/ubuntu/Llama_SQL/llama/lib/python3.8/site-packages/ctransformers/llm.py", line 246, in __init__
    self._lib = load_library(lib, gpu=config.gpu_layers > 0)
  File "/home/ubuntu/Llama_SQL/llama/lib/python3.8/site-packages/ctransformers/llm.py", line 126, in load_library
    lib = CDLL(path)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 369, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /home/ubuntu/Llama_SQL/llama/lib/python3.8/site-packages/ctransformers/lib/avx2/libctransformers.so)

I can understand that the Ubuntu version is old, but is there any chance to find the version of ctransformers that can run on my ubuntu?

harryjulian commented 1 year ago

https://github.com/marella/ctransformers/issues/58#issuecomment-1656702193