mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-28 03:38:11 +08:00
fix builtin model fail when parsing (#13657)
### What problem does this PR solve? using builtin model when parsing gave an error because it expects fid==builtin. split_model_name_and_factory returns id=None. pr allows the model to be accepted wheter with or without @Builtin ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -40,7 +40,14 @@ def get_model_config_by_type_and_name(tenant_id: str, model_type: str, model_nam
|
||||
if not model_config:
|
||||
# model_name in format 'name@factory', split model_name and try again
|
||||
pure_model_name, fid = TenantLLMService.split_model_name_and_factory(model_name)
|
||||
if model_type_val == LLMType.EMBEDDING.value and fid == "Builtin" and "tei-" in os.getenv("COMPOSE_PROFILES", "") and pure_model_name == os.getenv("TEI_MODEL", ""):
|
||||
compose_profiles = os.getenv("COMPOSE_PROFILES", "")
|
||||
is_tei_builtin_embedding = (
|
||||
model_type_val == LLMType.EMBEDDING.value
|
||||
and "tei-" in compose_profiles
|
||||
and pure_model_name == os.getenv("TEI_MODEL", "")
|
||||
and (fid == "Builtin" or fid is None)
|
||||
)
|
||||
if is_tei_builtin_embedding:
|
||||
# configured local embedding model
|
||||
embedding_cfg = settings.EMBEDDING_CFG
|
||||
config_dict = {
|
||||
|
||||
Reference in New Issue
Block a user