mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 16:49:00 +08:00
fix: multiple retrieval default weighted score (#6897)
This commit is contained in:
parent
8166a8caf5
commit
33dab4fe54
@ -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],
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user