Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
bb98f575
Unverified
Commit
bb98f575
authored
Nov 25, 2023
by
zxhlyh
Committed by
GitHub
Nov 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add xinference rerank model (#1619)
parent
e1d22033
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
index.tsx
web/app/components/app/chat/more-info/index.tsx
+4
-4
xinference.tsx
.../header/account-setting/model-page/configs/xinference.tsx
+7
-0
Form.tsx
...ts/header/account-setting/model-page/model-modal/Form.tsx
+2
-1
No files found.
web/app/components/app/chat/more-info/index.tsx
View file @
bb98f575
...
@@ -14,10 +14,10 @@ export type IMoreInfoProps = {
...
@@ -14,10 +14,10 @@ export type IMoreInfoProps = {
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
className=
'mr-2'
>
{
`${t('appLog.detail.timeConsuming')} ${more.latency}${t('appLog.detail.second')}`
}
</
span
>
<
span
>
{
`${t('appLog.detail.tokenCost')} ${formatNumber(more.tokens)}`
}
</
span
>
<
span
className=
'mr-2'
>
{
`${t('appLog.detail.tokenCost')} ${formatNumber(more.tokens)}`
}
</
span
>
<
span
>
·
</
span
>
<
span
className=
'mr-2'
>
·
</
span
>
<
span
>
{
more
.
time
}
</
span
>
<
span
>
{
more
.
time
}
</
span
>
</
div
>)
</
div
>)
}
}
export
default
React
.
memo
(
MoreInfo
)
export
default
React
.
memo
(
MoreInfo
)
web/app/components/header/account-setting/model-page/configs/xinference.tsx
View file @
bb98f575
...
@@ -80,6 +80,13 @@ const config: ProviderConfig = {
...
@@ -80,6 +80,13 @@ const config: ProviderConfig = {
'zh-Hans'
:
'Embeddings'
,
'zh-Hans'
:
'Embeddings'
,
},
},
},
},
{
key
:
'reranking'
,
label
:
{
'en'
:
'Rerank'
,
'zh-Hans'
:
'Rerank'
,
},
},
],
],
},
},
{
{
...
...
web/app/components/header/account-setting/model-page/model-modal/Form.tsx
View file @
bb98f575
...
@@ -150,10 +150,11 @@ const Form: FC<FormProps> = ({
...
@@ -150,10 +150,11 @@ const Form: FC<FormProps> = ({
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment