Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cc706fb

Browse filesBrowse files
committed
Add ctx check and re-order __init__. Closes abetlen#112
1 parent 996e31d commit cc706fb
Copy full SHA for cc706fb

File tree

Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed

‎llama_cpp/llama.py

Copy file name to clipboardExpand all lines: llama_cpp/llama.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,18 @@ def __init__(
133133

134134
self.n_threads = n_threads or max(multiprocessing.cpu_count() // 2, 1)
135135

136+
self.lora_base = lora_base
137+
self.lora_path = lora_path
138+
136139
if not os.path.exists(model_path):
137140
raise ValueError(f"Model path does not exist: {model_path}")
138141

139142
self.ctx = llama_cpp.llama_init_from_file(
140143
self.model_path.encode("utf-8"), self.params
141144
)
142145

143-
self.lora_base = lora_base
144-
self.lora_path = lora_path
146+
assert self.ctx is not None
147+
145148
if self.lora_path:
146149
if llama_cpp.llama_apply_lora_from_file(
147150
self.ctx,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.