Merge remote-tracking branch 'origin' into fix/trust_remote_code_

This commit is contained in:
suluyan
2025-03-13 15:54:09 +08:00

View File

@@ -263,7 +263,6 @@ def external_engine_for_llm_checker(model: Union[str, List[str], Model,
kwargs: Dict[str, Any]) -> Optional[str]: kwargs: Dict[str, Any]) -> Optional[str]:
from .nlp.llm_pipeline import ModelTypeHelper, LLMAdapterRegistry from .nlp.llm_pipeline import ModelTypeHelper, LLMAdapterRegistry
from ..hub.check_model import get_model_id_from_cache from ..hub.check_model import get_model_id_from_cache
from swift.llm import get_model_info_meta
if isinstance(model, list): if isinstance(model, list):
model = model[0] model = model[0]
if not isinstance(model, str): if not isinstance(model, str):
@@ -271,6 +270,7 @@ def external_engine_for_llm_checker(model: Union[str, List[str], Model,
llm_framework = kwargs.get('llm_framework', '') llm_framework = kwargs.get('llm_framework', '')
if llm_framework == 'swift': if llm_framework == 'swift':
from swift.llm import get_model_info_meta
# check if swift supports # check if swift supports
if os.path.exists(model): if os.path.exists(model):
model_id = get_model_id_from_cache(model) model_id = get_model_id_from_cache(model)