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 1a6a9a3

Browse filesBrowse files
committed
Add ggml_type
1 parent c4a2f85 commit 1a6a9a3
Copy full SHA for 1a6a9a3

File tree

Expand file treeCollapse file tree

1 file changed

+64
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+64
-0
lines changed

‎llama_cpp/llama_cpp.py

Copy file name to clipboardExpand all lines: llama_cpp/llama_cpp.py
+64Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,70 @@ def byref(obj: CtypesCData, offset: Optional[int] = None) -> CtypesRef[CtypesCDa
141141

142142
byref = ctypes.byref # type: ignore
143143

144+
# from ggml.h
145+
# // NOTE: always add types at the end of the enum to keep backward compatibility
146+
# enum ggml_type {
147+
# GGML_TYPE_F32 = 0,
148+
# GGML_TYPE_F16 = 1,
149+
# GGML_TYPE_Q4_0 = 2,
150+
# GGML_TYPE_Q4_1 = 3,
151+
# // GGML_TYPE_Q4_2 = 4, support has been removed
152+
# // GGML_TYPE_Q4_3 = 5, support has been removed
153+
# GGML_TYPE_Q5_0 = 6,
154+
# GGML_TYPE_Q5_1 = 7,
155+
# GGML_TYPE_Q8_0 = 8,
156+
# GGML_TYPE_Q8_1 = 9,
157+
# GGML_TYPE_Q2_K = 10,
158+
# GGML_TYPE_Q3_K = 11,
159+
# GGML_TYPE_Q4_K = 12,
160+
# GGML_TYPE_Q5_K = 13,
161+
# GGML_TYPE_Q6_K = 14,
162+
# GGML_TYPE_Q8_K = 15,
163+
# GGML_TYPE_IQ2_XXS = 16,
164+
# GGML_TYPE_IQ2_XS = 17,
165+
# GGML_TYPE_IQ3_XXS = 18,
166+
# GGML_TYPE_IQ1_S = 19,
167+
# GGML_TYPE_IQ4_NL = 20,
168+
# GGML_TYPE_IQ3_S = 21,
169+
# GGML_TYPE_IQ2_S = 22,
170+
# GGML_TYPE_IQ4_XS = 23,
171+
# GGML_TYPE_I8 = 24,
172+
# GGML_TYPE_I16 = 25,
173+
# GGML_TYPE_I32 = 26,
174+
# GGML_TYPE_I64 = 27,
175+
# GGML_TYPE_F64 = 28,
176+
# GGML_TYPE_IQ1_M = 29,
177+
# GGML_TYPE_COUNT,
178+
# };
179+
GGML_TYPE_F32 = 0
180+
GGML_TYPE_F16 = 1
181+
GGML_TYPE_Q4_0 = 2
182+
GGML_TYPE_Q4_1 = 3
183+
GGML_TYPE_Q5_0 = 6
184+
GGML_TYPE_Q5_1 = 7
185+
GGML_TYPE_Q8_0 = 8
186+
GGML_TYPE_Q8_1 = 9
187+
GGML_TYPE_Q2_K = 10
188+
GGML_TYPE_Q3_K = 11
189+
GGML_TYPE_Q4_K = 12
190+
GGML_TYPE_Q5_K = 13
191+
GGML_TYPE_Q6_K = 14
192+
GGML_TYPE_Q8_K = 15
193+
GGML_TYPE_IQ2_XXS = 16
194+
GGML_TYPE_IQ2_XS = 17
195+
GGML_TYPE_IQ3_XXS = 18
196+
GGML_TYPE_IQ1_S = 19
197+
GGML_TYPE_IQ4_NL = 20
198+
GGML_TYPE_IQ3_S = 21
199+
GGML_TYPE_IQ2_S = 22
200+
GGML_TYPE_IQ4_XS = 23
201+
GGML_TYPE_I8 = 24
202+
GGML_TYPE_I16 = 25
203+
GGML_TYPE_I32 = 26
204+
GGML_TYPE_I64 = 27
205+
GGML_TYPE_F64 = 28
206+
GGML_TYPE_IQ1_M = 29
207+
GGML_TYPE_COUNT = 30
144208

145209
# from ggml-backend.h
146210
# typedef bool (*ggml_backend_sched_eval_callback)(struct ggml_tensor * t, bool ask, void * user_data);

0 commit comments

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