Commit 7e7930f5 authored by Your Name's avatar Your Name

Fix: Use cached file path when reloading URL-based models

- When reloading a default model that was loaded from a URL,
  check for cached file path and use it instead of the URL
parent dd924c1a
...@@ -2466,6 +2466,15 @@ class MultiModelManager: ...@@ -2466,6 +2466,15 @@ class MultiModelManager:
from llama_cpp import Llama from llama_cpp import Llama
backend = self.config[self.default_model].get('backend_type', 'auto') backend = self.config[self.default_model].get('backend_type', 'auto')
model_path = self.default_model model_path = self.default_model
# Check if model_path is a URL and try to get cached path
if model_path.startswith('http://') or model_path.startswith('https://'):
cached_path = get_cached_model_path(model_path)
if cached_path:
model_path = cached_path
print(f"Using cached model path: {model_path}")
else:
print(f"Warning: Model URL not cached, cannot reload: {model_path}")
return None
load_kwargs = self.config[self.default_model].copy() load_kwargs = self.config[self.default_model].copy()
load_kwargs.pop('backend_type', None) load_kwargs.pop('backend_type', None)
print(f"Reloading default model: {model_path}") print(f"Reloading default model: {model_path}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment