Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lmp_web
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
yujian
lmp_web
Commits
69263c44
Commit
69263c44
authored
Dec 25, 2023
by
mhw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
知识图谱添加
parent
481f7e42
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
2 deletions
+45
-2
gptStaticDict.js
src/staticDict/gptStaticDict.js
+5
-0
index.vue
.../modelService/testOnline/components/contentView/index.vue
+1
-1
index.vue
...ning/modelService/testOnline/components/leftBox/index.vue
+28
-1
index.vue
...ing/modelService/testOnline/components/rightBox/index.vue
+11
-0
No files found.
src/staticDict/gptStaticDict.js
View file @
69263c44
...
@@ -414,6 +414,11 @@ const ModeOfSpeaking = new DictionaryBase('对话模式', [
...
@@ -414,6 +414,11 @@ const ModeOfSpeaking = new DictionaryBase('对话模式', [
id
:
3
,
id
:
3
,
name
:
'文件对话'
,
name
:
'文件对话'
,
symbol
:
'fileSession'
symbol
:
'fileSession'
},
{
id
:
4
,
name
:
'知识图谱问答'
,
symbol
:
'knowledgeGraph'
}
}
// {
// {
// id: 2,
// id: 2,
...
...
src/views/gptTraining/modelService/testOnline/components/contentView/index.vue
View file @
69263c44
...
@@ -86,7 +86,7 @@ export default {
...
@@ -86,7 +86,7 @@ export default {
describeDom
.
classList
.
add
(
'describe'
)
describeDom
.
classList
.
add
(
'describe'
)
let
height
=
describeDom
.
scrollHeight
let
height
=
describeDom
.
scrollHeight
describeDom
.
setAttribute
(
'style'
,
`height:
${
height
}
px;`
)
describeDom
.
setAttribute
(
'style'
,
'height:0px;'
)
describeDom
.
previousElementSibling
.
addEventListener
(
'click'
,
function
(
event
)
{
describeDom
.
previousElementSibling
.
addEventListener
(
'click'
,
function
(
event
)
{
if
(
height
>
0
&&
(
describeDom
.
style
.
height
!==
'0px'
&&
describeDom
.
style
.
height
!==
''
))
{
if
(
height
>
0
&&
(
describeDom
.
style
.
height
!==
'0px'
&&
describeDom
.
style
.
height
!==
''
))
{
describeDom
.
setAttribute
(
'style'
,
'height:0px;'
)
describeDom
.
setAttribute
(
'style'
,
'height:0px;'
)
...
...
src/views/gptTraining/modelService/testOnline/components/leftBox/index.vue
View file @
69263c44
...
@@ -92,6 +92,26 @@
...
@@ -92,6 +92,26 @@
</el-collapse-item>
</el-collapse-item>
</el-collapse>
</el-collapse>
</el-form-item>
</el-form-item>
<el-form-item
label-width=
"0px"
v-if=
"form.pattern == '知识图谱问答'"
>
<el-collapse
value=
"1"
>
<el-collapse-item
name=
"1"
>
<
template
slot=
"title"
>
知识图谱配置
</
template
>
<el-form-item
label=
"请选择知识图谱:"
style=
"margin-bottom:30px"
>
<el-select
ref=
"knowledgeSelect"
v-model=
"form.knowledgeGraphConfige. knowledge_graph_name"
placeholder=
"请选择"
>
<el-option
v-for=
"item in []"
:key=
"item.knowledgeId"
:label=
"item.knowledgeGraphName"
:value=
"item.knowledgeGraphName"
>
</el-option>
</el-select>
<!-- <div class="el-upload__tip" >{{knowledgeDescribe}}</div> -->
</el-form-item>
<el-form-item
label=
"匹配知识条数:"
style=
"margin-bottom:30px"
>
<el-input-number
v-model=
"form.knowledgeGraphConfige.top_k"
:min=
"1"
:max=
"20"
></el-input-number>
</el-form-item>
<el-form-item
label=
"匹配精度:"
>
<el-slider
v-model=
"knowledgeScoreThreshold"
:format-tooltip=
"formatTooltip"
@
change=
"form.knowledgeGraphConfige.score_threshold = knowledgeGraphThreshold / 100"
></el-slider>
</el-form-item>
</el-collapse-item>
</el-collapse>
</el-form-item>
</el-form>
</el-form>
</template>
</template>
...
@@ -114,6 +134,7 @@ export default {
...
@@ -114,6 +134,7 @@ export default {
knowledgeList
:
[],
knowledgeList
:
[],
knowledgeScoreThreshold
:
50
,
knowledgeScoreThreshold
:
50
,
fileThreshold
:
50
,
fileThreshold
:
50
,
knowledgeGraphThreshold
:
50
,
form
:
{
form
:
{
pattern
:
'通用智能问答'
,
// 对话模式
pattern
:
'通用智能问答'
,
// 对话模式
model_name
:
undefined
,
// 模型名称
model_name
:
undefined
,
// 模型名称
...
@@ -129,13 +150,19 @@ export default {
...
@@ -129,13 +150,19 @@ export default {
search_engine_name
:
'bing'
,
search_engine_name
:
'bing'
,
top_k
:
1
top_k
:
1
},
},
fileConfige
:
{
fileConfige
:
{
// 文件对哈配置
top_k
:
1
,
top_k
:
1
,
score_threshold
:
0.5
,
score_threshold
:
0.5
,
knowledge_id
:
undefined
,
knowledge_id
:
undefined
,
// max_tokens: 0,
// max_tokens: 0,
prompt_name
:
'default'
prompt_name
:
'default'
},
knowledgeGraphConfige
:
{
// 知识图谱对话
knowledge_graph_name
:
''
,
top_k
:
1
,
score_threshold
:
0.5
}
}
},
},
filesForm
:
{
filesForm
:
{
...
...
src/views/gptTraining/modelService/testOnline/components/rightBox/index.vue
View file @
69263c44
...
@@ -110,6 +110,9 @@ export default {
...
@@ -110,6 +110,9 @@ export default {
this
.
$message
.
error
(
'请先上传文件'
);
this
.
$message
.
error
(
'请先上传文件'
);
return
return
}
}
}
else
if
(
this
.
chatForm
.
pattern
===
'知识图谱问答'
)
{
apiUrl
=
'/2api/chat/mapping_knowledge'
this
.
param
=
{
...
this
.
param
,
...
this
.
chatForm
.
knowledgeGraphConfige
}
}
}
if
(
!
this
.
inputContent
)
return
if
(
!
this
.
inputContent
)
return
this
.
param
.
query
=
this
.
inputContent
;
this
.
param
.
query
=
this
.
inputContent
;
...
@@ -155,6 +158,14 @@ export default {
...
@@ -155,6 +158,14 @@ export default {
}
else
if
(
this
.
chatForm
.
pattern
===
'文件对话'
)
{
}
else
if
(
this
.
chatForm
.
pattern
===
'文件对话'
)
{
let
temporary
=
JSON
.
parse
(
`[
${
data
}
]`
.
replace
(
/}{/g
,
'},{'
))
let
temporary
=
JSON
.
parse
(
`[
${
data
}
]`
.
replace
(
/}{/g
,
'},{'
))
temporary
.
forEach
((
item
)
=>
{
this
.
modifyContent
(
item
)
// 修改返回内容
nowChat
.
excludeReferenceAnswer
+=
item
.
answer
||
''
// 排除回答中的引用内容
nowChat
.
answer
+=
item
.
answer
||
'
\
n'
+
item
.
docs
})
}
else
if
(
this
.
chatForm
.
pattern
===
'知识图谱对话'
)
{
let
temporary
=
JSON
.
parse
(
`[
${
data
}
]`
.
replace
(
/}{/g
,
'},{'
))
temporary
.
forEach
((
item
)
=>
{
temporary
.
forEach
((
item
)
=>
{
this
.
modifyContent
(
item
)
// 修改返回内容
this
.
modifyContent
(
item
)
// 修改返回内容
nowChat
.
excludeReferenceAnswer
+=
item
.
answer
||
''
// 排除回答中的引用内容
nowChat
.
excludeReferenceAnswer
+=
item
.
answer
||
''
// 排除回答中的引用内容
...
...
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