fix reranking model field error (#6654)

This commit is contained in:
Jyong 2024-07-25 10:07:55 +08:00 committed by GitHub
parent 4ec9a87e46
commit 91fd8521c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -46,8 +46,8 @@ class MultipleRetrievalConfig(BaseModel):
score_threshold: Optional[float] = None
reranking_mode: str = 'reranking_model'
reranking_enable: bool = True
reranking_model: RerankingModelConfig
weights: WeightedScoreConfig
reranking_model: Optional[RerankingModelConfig] = None
weights: Optional[WeightedScoreConfig] = None
class ModelConfig(BaseModel):

View File

@ -140,8 +140,8 @@ class KnowledgeRetrievalNode(BaseNode):
elif node_data.retrieval_mode == DatasetRetrieveConfigEntity.RetrieveStrategy.MULTIPLE.value:
if node_data.multiple_retrieval_config.reranking_mode == 'reranking_model':
reranking_model = {
'reranking_provider_name': node_data.multiple_retrieval_config.reranking_model['provider'],
'reranking_model_name': node_data.multiple_retrieval_config.reranking_model['name']
'reranking_provider_name': node_data.multiple_retrieval_config.reranking_model.provider,
'reranking_model_name': node_data.multiple_retrieval_config.reranking_model.model
}
weights = None
elif node_data.multiple_retrieval_config.reranking_mode == 'weighted_score':