File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,8 @@ def set_gguf_max_gpu_layers(n_layers: int):
190190 """Sets the maximum number of layers to use for the GGUF model."""
191191 if not isinstance (n_layers , int ):
192192 raise ValueError ("n_layers must be an integer" )
193+ if n_layers < - 1 :
194+ n_layers = - 1
193195 os .environ [_GGUF_MAX_GPU_LAYERS ] = str (n_layers )
194196
195197 @staticmethod
Original file line number Diff line number Diff line change @@ -81,6 +81,12 @@ def _get_openai_key(self) -> str:
8181 key = self .key
8282 if key is None :
8383 key = _Config .get_openai_key ()
84+ if (
85+ hasattr (self , "model" )
86+ and isinstance (self .model , str )
87+ and self .model .startswith ("gguf::" )
88+ ):
89+ key = "gguf"
8490 if key is None :
8591 raise RuntimeError ("OpenAI key was not found" )
8692 return key
You can’t perform that action at this time.
0 commit comments