File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,9 @@ def load(self):
309
309
if self ._is_loaded :
310
310
return
311
311
312
+ if self .model .startswith ("ollama/" ) and not ":" in self .model :
313
+ self .model = self .model + ":latest"
314
+
312
315
self ._is_loaded = True
313
316
314
317
if self .model .startswith ("ollama/" ):
@@ -321,7 +324,7 @@ def load(self):
321
324
if response .ok :
322
325
data = response .json ()
323
326
names = [
324
- model ["name" ]. replace ( ":latest" , "" )
327
+ model ["name" ]
325
328
for model in data ["models" ]
326
329
if "name" in model and model ["name" ]
327
330
]
@@ -356,6 +359,7 @@ def load(self):
356
359
self .max_tokens = int (self .context_window * 0.2 )
357
360
358
361
# Send a ping, which will actually load the model
362
+ model_name = model_name .replace (":latest" , "" )
359
363
print (f"Loading { model_name } ...\n " )
360
364
361
365
old_max_tokens = self .max_tokens
@@ -396,6 +400,8 @@ def fixed_litellm_completions(**params):
396
400
else :
397
401
litellm .drop_params = True
398
402
403
+ params ["model" ] = params ["model" ].replace (":latest" , "" )
404
+
399
405
# Run completion
400
406
attempts = 4
401
407
first_error = None
You can’t perform that action at this time.
0 commit comments