Browse Source

feat: add xinference rerank model (#1619)

tags/0.3.32
zxhlyh 1 year ago
parent
commit
bb98f5756a
No account linked to committer's email address

+ 4
- 4
web/app/components/app/chat/more-info/index.tsx View File

const MoreInfo: FC<IMoreInfoProps> = ({ more, isQuestion, className }) => { const MoreInfo: FC<IMoreInfoProps> = ({ more, isQuestion, className }) => {
const { t } = useTranslation() const { t } = useTranslation()
return (<div className={`mt-1 w-full text-xs text-gray-400 ${isQuestion ? 'mr-2 text-right ' : 'pl-2 text-left float-right'} ${className}`}> return (<div className={`mt-1 w-full text-xs text-gray-400 ${isQuestion ? 'mr-2 text-right ' : 'pl-2 text-left float-right'} ${className}`}>
<span>{`${t('appLog.detail.timeConsuming')} ${more.latency}${t('appLog.detail.second')}`}</span>
<span>{`${t('appLog.detail.tokenCost')} ${formatNumber(more.tokens)}`}</span>
<span>· </span>
<span>{more.time} </span>
<span className='mr-2'>{`${t('appLog.detail.timeConsuming')} ${more.latency}${t('appLog.detail.second')}`}</span>
<span className='mr-2'>{`${t('appLog.detail.tokenCost')} ${formatNumber(more.tokens)}`}</span>
<span className='mr-2'>·</span>
<span>{more.time}</span>
</div>) </div>)
} }
export default React.memo(MoreInfo) export default React.memo(MoreInfo)

+ 7
- 0
web/app/components/header/account-setting/model-page/configs/xinference.tsx View File

'zh-Hans': 'Embeddings', 'zh-Hans': 'Embeddings',
}, },
}, },
{
key: 'reranking',
label: {
'en': 'Rerank',
'zh-Hans': 'Rerank',
},
},
], ],
}, },
{ {

+ 2
- 1
web/app/components/header/account-setting/model-page/model-modal/Form.tsx View File



if (field.type === 'radio') { if (field.type === 'radio') {
const options = typeof field.options === 'function' ? field.options(value) : field.options const options = typeof field.options === 'function' ? field.options(value) : field.options

return ( return (
<div key={field.key} className='py-3'> <div key={field.key} className='py-3'>
<div className={nameClassName}>{field.label[locale]}</div> <div className={nameClassName}>{field.label[locale]}</div>
<div className='grid grid-cols-2 gap-3'>
<div className={`grid grid-cols-${options?.length} gap-3`}>
{ {
options?.map(option => ( options?.map(option => (
<div <div

Loading…
Cancel
Save