minor fix

This commit is contained in:
suluyan
2025-03-11 20:42:01 +08:00
parent 257ee0573d
commit 164e5982b5
2 changed files with 7 additions and 4 deletions

View File

@@ -269,7 +269,8 @@ def external_engine_for_llm_checker(model: Union[str, List[str], Model,
if not isinstance(model, str):
model = model.model_dir
if kwargs.get('llm_framework') == 'swift':
llm_framework = kwargs.get('llm_framework', '')
if llm_framework == 'swift':
# check if swift supports
if os.path.exists(model):
model_id = get_model_id_from_cache(model)
@@ -280,9 +281,8 @@ def external_engine_for_llm_checker(model: Union[str, List[str], Model,
info = get_model_info_meta(model_id)
model_type = info[0].model_type
except Exception as e:
logger.warning(
f'Cannot using llm_framework with {model_id}, '
f'ignoring llm_framework={self.llm_framework} : {e}')
logger.warning(f'Cannot using llm_framework with {model_id}, '
f'ignoring llm_framework={llm_framework} : {e}')
model_type = None
if model_type:
return 'llm'

View File

@@ -43,6 +43,9 @@ def hf_pipeline(
device = _get_hf_device(device)
pipeline_class = _get_hf_pipeline_class(task, model)
kwargs.pop('external_engine_for_llm', None)
kwargs.pop('llm_framework', None)
return pipeline(
task=task,
model=model,