Skip to content

Commit

Permalink
Update llama.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
abetlen committed May 21, 2023
1 parent 8f49ca0 commit fafe471
Show file tree
Hide file tree
Showing 3 changed files with 186 additions and 44 deletions.
9 changes: 7 additions & 2 deletions llama_cpp/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def __init__(

self.params = llama_cpp.llama_context_default_params()
self.params.n_ctx = n_ctx
self.params.n_parts = n_parts
self.params.n_gpu_layers = n_gpu_layers
self.params.seed = seed
self.params.f16_kv = f16_kv
Expand All @@ -149,6 +148,10 @@ def __init__(
self.lora_base = lora_base
self.lora_path = lora_path

### DEPRECATED ###
self.n_parts = n_parts
### DEPRECATED ###

if not os.path.exists(model_path):
raise ValueError(f"Model path does not exist: {model_path}")

Expand Down Expand Up @@ -1225,7 +1228,6 @@ def __getstate__(self):
verbose=self.verbose,
model_path=self.model_path,
n_ctx=self.params.n_ctx,
n_parts=self.params.n_parts,
n_gpu_layers=self.params.n_gpu_layers,
seed=self.params.seed,
f16_kv=self.params.f16_kv,
Expand All @@ -1239,6 +1241,9 @@ def __getstate__(self):
n_threads=self.n_threads,
lora_base=self.lora_base,
lora_path=self.lora_path,
### DEPRECATED ###
n_parts=self.n_parts,
### DEPRECATED ###
)

def __setstate__(self, state):
Expand Down
Loading

0 comments on commit fafe471

Please sign in to comment.