File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
+ import re
2
3
import warnings
3
4
from typing import AsyncIterable
4
5
@@ -60,6 +61,15 @@ def __init__(
60
61
self .filename = filename
61
62
self .pipeline = prompt_pipeline
62
63
64
+ # for convenience, if the filename is *-00001-of-0000X.gguf, mark all the others as additional files if not set
65
+ if match := re .match (r"(.*?)-(\d+)-of-(\d+)\.gguf" , filename ):
66
+ additional_files = []
67
+ for n in range (int (match [3 ])):
68
+ if n == int (match [2 ]):
69
+ continue
70
+ additional_files .append (f"{ match [1 ]} -*{ n } -of-{ match [3 ]} .gguf" )
71
+ model_load_kwargs .setdefault ("additional_files" , additional_files )
72
+
63
73
model_load_kwargs .setdefault ("n_ctx" , max_context_size )
64
74
self .model = Llama .from_pretrained (repo_id = repo_id , filename = filename , ** model_load_kwargs )
65
75
self .hyperparams = hyperparams
Original file line number Diff line number Diff line change 18
18
pipeline = ChatTemplatePromptPipeline .from_pretrained ("deepseek-ai/DeepSeek-R1" )
19
19
engine = LlamaCppEngine (
20
20
repo_id = "unsloth/DeepSeek-R1-GGUF" ,
21
- filename = "DeepSeek-R1-GGUF/*UD-Q2_K_XL* .gguf" ,
21
+ filename = "DeepSeek-R1-Q2_K_XS/DeepSeek-R1-Q2_K_XS-00001-of-00005 .gguf" ,
22
22
prompt_pipeline = pipeline ,
23
23
model_load_kwargs = {"n_gpu_layers" : - 1 },
24
24
)
You can’t perform that action at this time.
0 commit comments