Commit 2983ddf4 authored by Your Name's avatar Your Name

Fix: Properly resolve 'default' model name to actual model

When requested_model is 'default', get_resolved_model_name now:
1. First tries current_manager.default_model
2. Falls back to the first model in manager.models

This ensures the model family is correctly detected for parser selection.
parent d16f206e
...@@ -117,13 +117,18 @@ def get_resolved_model_name(requested_model: str, current_manager = None) -> str ...@@ -117,13 +117,18 @@ def get_resolved_model_name(requested_model: str, current_manager = None) -> str
# Try to get from current manager if available # Try to get from current manager if available
if current_manager is not None: if current_manager is not None:
# Check if the model is loaded in the manager # Check if the model is loaded in the manager
if hasattr(current_manager, 'models'): if hasattr(current_manager, 'models') and current_manager.models:
# If requested_model is "default" or empty, get the first loaded model
if requested_model in ("default", "", None) or not requested_model:
# Try default_model first
if hasattr(current_manager, 'default_model') and current_manager.default_model:
return current_manager.default_model
# Otherwise return the first model in the dict
return list(current_manager.models.keys())[0]
# Check if the model is loaded in the manager
for key, model in current_manager.models.items(): for key, model in current_manager.models.items():
if requested_model == key or requested_model in key: if requested_model == key or requested_model in key:
return key return key
if hasattr(current_manager, 'default_model'):
if requested_model == "default":
return current_manager.default_model
# Check if it's a HuggingFace model ID - if so, return as-is # Check if it's a HuggingFace model ID - if so, return as-is
if '/' in requested_model: if '/' in requested_model:
......
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