Commit 3d6d3501 authored by mhw's avatar mhw

Merge branch 'ljgc-web' of http://218.76.0.69:3000/lmp/lmp_web into ljgc-web

parents e4cff086 4e37ed14
module.exports = { module.exports = {
baseUrl: 'http://127.0.0.1:8082/', baseUrl: 'http://192.168.83.215:8082/',
wsUrl: 'ws://127.0.0.1:7860/', wsUrl: 'ws://127.0.0.1:7860/',
projectName: '灵境大模型平台' projectName: '灵境大模型平台'
} }
...@@ -320,7 +320,7 @@ const TaskType = new DictionaryBase('任务类型', [ ...@@ -320,7 +320,7 @@ const TaskType = new DictionaryBase('任务类型', [
name: '模型压缩', name: '模型压缩',
symbol: 'ModelCompression' symbol: 'ModelCompression'
} }
]); ]);
Vue.prototype.TaskType = TaskType; Vue.prototype.TaskType = TaskType;
// const SftTaskType = new DictionaryBase('sft任务类型', [ // const SftTaskType = new DictionaryBase('sft任务类型', [
...@@ -334,7 +334,7 @@ Vue.prototype.TaskType = TaskType; ...@@ -334,7 +334,7 @@ Vue.prototype.TaskType = TaskType;
// name: '文生图模型', // name: '文生图模型',
// symbol: '' // symbol: ''
// } // }
// ]); // ]);
// Vue.prototype.SftTaskType = SftTaskType; // Vue.prototype.SftTaskType = SftTaskType;
const TaskStatus = new DictionaryBase('任务状态', [ const TaskStatus = new DictionaryBase('任务状态', [
...@@ -402,12 +402,12 @@ Vue.prototype.PublishWay = PublishWay; ...@@ -402,12 +402,12 @@ Vue.prototype.PublishWay = PublishWay;
const ModeOfSpeaking = new DictionaryBase('对话模式', [ const ModeOfSpeaking = new DictionaryBase('对话模式', [
{ {
id: 0, id: 0,
name: 'LLM 对话', name: '通用智能问答',
symbol: 'llm' symbol: 'llm'
}, },
{ {
id: 1, id: 1,
name: '知识库问答', name: '专业知识库问答',
symbol: 'repository' symbol: 'repository'
}, },
{ {
...@@ -423,7 +423,7 @@ const ModeOfSpeaking = new DictionaryBase('对话模式', [ ...@@ -423,7 +423,7 @@ const ModeOfSpeaking = new DictionaryBase('对话模式', [
]); ]);
Vue.prototype.ModeOfSpeaking = ModeOfSpeaking; Vue.prototype.ModeOfSpeaking = ModeOfSpeaking;
const RunningStatus = new DictionaryBase('运行状态', [ const RunningStatus = new DictionaryBase('运行状态', [
{ {
id: -1, id: -1,
name: '训练失败', name: '训练失败',
......
<!--左侧操作界面 --> <!--左侧操作界面 -->
<template> <template>
<el-form label-position="left" ref="form" label-width="120px" :model="form" :size="defaultFormItemSize" style="padding:20px;width:400px" v-loading.fullscreen.lock="fullscreenLoading"> <el-form label-position="left" ref="form" label-width="120px" :model="form" :size="defaultFormItemSize" style="padding:20px;width:400px" v-loading.fullscreen.lock="fullscreenLoading">
<el-form-item label="对话模式:"> <el-form-item label="问答模式:">
<el-select v-model="form.pattern" placeholder="请选择" @change="patternChange"> <el-select v-model="form.pattern" placeholder="请选择" @change="patternChange">
<el-option v-for="item in ModeOfSpeaking.getList()" :key="item.id" :label="item.name" :value="item.name"> <el-option v-for="item in ModeOfSpeaking.getList()" :key="item.id" :label="item.name" :value="item.name">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="LLM模型:"> <el-form-item label="模型选择:">
<el-cascader v-model="form.model_name" ref="modelCascader" :options="modelList" :props='{ label: "name", value: "name", emitPath: false }' @change="changeModel"></el-cascader> <el-cascader v-model="form.model_name" ref="modelCascader" :options="modelList" :props='{ label: "name", value: "name", emitPath: false }' @change="changeModel"></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="Temperature:"> <el-form-item label="Temperature:">
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
{{ form.prompt_template }} {{ form.prompt_template }}
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label-width="0px" v-if="form.pattern == '知识库问答'"> <el-form-item label-width="0px" v-if="form.pattern == '专业知识库问答'">
<el-collapse value="1"> <el-collapse value="1">
<el-collapse-item name="1"> <el-collapse-item name="1">
<template slot="title">知识库配置</template> <template slot="title">知识库配置</template>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<el-form-item label="匹配知识条数:" style="margin-bottom:30px"> <el-form-item label="匹配知识条数:" style="margin-bottom:30px">
<el-input-number v-model="form.knowledgeConfige.top_k" :min="1" :max="20"></el-input-number> <el-input-number v-model="form.knowledgeConfige.top_k" :min="1" :max="20"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="知识匹配分数阈值:"> <el-form-item label="匹配精度:">
<el-slider v-model="knowledgeScoreThreshold" :format-tooltip="formatTooltip" @change="form.knowledgeConfige.score_threshold = knowledgeScoreThreshold / 100"></el-slider> <el-slider v-model="knowledgeScoreThreshold" :format-tooltip="formatTooltip" @change="form.knowledgeConfige.score_threshold = knowledgeScoreThreshold / 100"></el-slider>
</el-form-item> </el-form-item>
</el-collapse-item> </el-collapse-item>
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
knowledgeScoreThreshold: 50, knowledgeScoreThreshold: 50,
fileThreshold: 50, fileThreshold: 50,
form: { form: {
pattern: 'LLM 对话', // 对话模式 pattern: '通用智能问答', // 对话模式
model_name: undefined, // 模型名称 model_name: undefined, // 模型名称
temperature: 0.7, temperature: 0.7,
prompt_template: '', prompt_template: '',
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div v-for="(item, index) in myHistory" :key="index"> <div v-for="(item, index) in myHistory" :key="index">
<div class="userBox"> <div class="userBox">
<div class="content"> <div class="content">
<contentView :content="item.content" /> <contentView :content="item.content" />
</div> </div>
<div class="icon"> <div class="icon">
...@@ -96,9 +96,9 @@ export default { ...@@ -96,9 +96,9 @@ export default {
this.heistoryRotate = this.chatForm.heistoryRotate this.heistoryRotate = this.chatForm.heistoryRotate
this.param.prompt_template = this.isPromptTemplate ? this.chatForm.prompt_template : undefined this.param.prompt_template = this.isPromptTemplate ? this.chatForm.prompt_template : undefined
let apiUrl let apiUrl
if (this.chatForm.pattern === 'LLM 对话') { if (this.chatForm.pattern === '通用智能问答') {
apiUrl = '/2api/chat/chat' apiUrl = '/2api/chat/chat'
} else if (this.chatForm.pattern === '知识库问答') { } else if (this.chatForm.pattern === '专业知识库问答') {
apiUrl = '/2api/chat/knowledge_base_chat' apiUrl = '/2api/chat/knowledge_base_chat'
this.param = { ...this.param, ...this.chatForm.knowledgeConfige } this.param = { ...this.param, ...this.chatForm.knowledgeConfige }
} else if (this.chatForm.pattern === '搜索引擎问答') { } else if (this.chatForm.pattern === '搜索引擎问答') {
...@@ -137,9 +137,9 @@ export default { ...@@ -137,9 +137,9 @@ export default {
onmessage (data) { onmessage (data) {
let nowChat = this.myHistory[this.myHistory.length - 1] let nowChat = this.myHistory[this.myHistory.length - 1]
if (this.chatForm.pattern === 'LLM 对话') { if (this.chatForm.pattern === '通用智能问答') {
nowChat.answer += data nowChat.answer += data
} 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) => { temporary.forEach((item) => {
if (item.docs) { if (item.docs) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment