fix: multiple retrieval default weighted score (#6897)

This commit is contained in:
zxhlyh 2024-08-02 14:05:27 +08:00 committed by GitHub
parent 8166a8caf5
commit 33dab4fe54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -16,6 +16,7 @@ import ModelSelector from '@/app/components/header/account-setting/model-provide
import { useModelListAndDefaultModel } from '@/app/components/header/account-setting/model-provider-page/hooks'
import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
import {
DEFAULT_WEIGHTED_SCORE,
RerankingModeEnum,
WeightedScoreEnum,
} from '@/models/datasets'
@ -69,12 +70,12 @@ const RetrievalParamConfig: FC<Props> = ({
result.weights = {
weight_type: WeightedScoreEnum.Customized,
vector_setting: {
vector_weight: 0.5,
vector_weight: DEFAULT_WEIGHTED_SCORE.other.semantic,
embedding_provider_name: '',
embedding_model_name: '',
},
keyword_setting: {
keyword_weight: 0.5,
keyword_weight: DEFAULT_WEIGHTED_SCORE.other.keyword,
},
}
}
@ -202,7 +203,6 @@ const RetrievalParamConfig: FC<Props> = ({
value.reranking_mode === RerankingModeEnum.WeightedScore && (
<WeightedScore
value={{
type: value.weights!.weight_type,
value: [
value.weights!.vector_setting.vector_weight,
value.weights!.keyword_setting.keyword_weight,
@ -213,7 +213,6 @@ const RetrievalParamConfig: FC<Props> = ({
...value,
weights: {
...value.weights!,
weight_type: v.type,
vector_setting: {
...value.weights!.vector_setting,
vector_weight: v.value[0],

View File

@ -88,7 +88,7 @@ export const getMultipleRetrievalConfig = (multipleRetrievalConfig: MultipleRetr
reranking_mode,
reranking_model,
weights,
reranking_enable,
reranking_enable: allEconomic ? reranking_enable : true,
}
if (allEconomic || mixtureHighQualityAndEconomic || inconsistentEmbeddingModel)