marella / ctransformers

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

Loading local QPTQ LLM from safetensors #89

Open tmwstw7 opened 1 year ago

tmwstw7 commented 1 year ago

I'm trying to load TheBloke/Llama-2-7b-Chat-GPTQ from the local directory with the sample code provided here:

from ctransformers import AutoModelForCausalLM
llm = AutoModelForCausalLM.from_pretrained("./my_folder/TheBloke/Llama-2-7B-GPTQ", model_type="gptq") 

but it seems like .from_pretrained is looking for .bin model rather than .safetensors, thus it is unable to load , model with an error like: "No model file found in directory". I tried to pass use_safetensors but as I saw from the definition of a method, it doesn't have this parameter. Can somebody guide me on what should I do to be able to load GPTQ LLMs from local path?

marella commented 1 year ago

Please post the full error message with stack trace and make sure you are using the latest version:

pip install ctransformers --upgrade
tmwstw7 commented 10 months ago

Here is the error:

image

and the content of model folder:

image

ctransformers version: 0.2.17, installed with [gptq]