Skip to content

Commit

Permalink
Merge branch 'chore/offline-n-to-1-retrieval' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zxhlyh committed Sep 9, 2024
2 parents 420349c + 78354a5 commit dd58c20
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { memo, useMemo } from 'react'
import { memo, useEffect, useMemo } from 'react'
import type { FC } from 'react'
import { useTranslation } from 'react-i18next'
import WeightedScore from './weighted-score'
Expand Down Expand Up @@ -47,6 +47,15 @@ const ConfigContent: FC<Props> = ({
const selectedDatasetsMode = useSelectedDatasetsMode(selectedDatasets)
const type = datasetConfigs.retrieval_model

useEffect(() => {
if (type === RETRIEVE_TYPE.oneWay) {
onChange({
...datasetConfigs,
retrieval_model: RETRIEVE_TYPE.multiWay,
})
}
}, [type])

const {
modelList: rerankModelList,
defaultModel: rerankDefaultModel,
Expand Down Expand Up @@ -151,6 +160,12 @@ const ConfigContent: FC<Props> = ({
</div>
{type === RETRIEVE_TYPE.multiWay && (
<>
<div className='flex items-center my-2 py-1 h-6'>
<div className='shrink-0 mr-2 system-xs-semibold-uppercase text-text-secondary'>
{t('dataset.rerankSettings')}
</div>
<div className='grow h-[1px] bg-gradient-to-l from-white to-[rgba(16,24,40,0.08)]'></div>
</div>
{
selectedDatasetsMode.inconsistentEmbeddingModel
&& (
Expand Down

0 comments on commit dd58c20

Please sign in to comment.