Merge branch 'main' of github.com:maxkb-dev/maxkb

This commit is contained in:
shaohuzhang1 2024-03-11 17:28:41 +08:00
commit 4589555af6
4 changed files with 71 additions and 52 deletions

View File

@ -82,6 +82,10 @@ model_dict = {
'llama2-chinese:13b-maxkb', 'llama2-chinese:13b-maxkb',
'由于Llama2本身的中文对齐较弱我们采用中文指令集对meta-llama/Llama-2-13b-chat-hf进行LoRA微调使其具备较强的中文对话能力。fi2cloud专用', '由于Llama2本身的中文对齐较弱我们采用中文指令集对meta-llama/Llama-2-13b-chat-hf进行LoRA微调使其具备较强的中文对话能力。fi2cloud专用',
ModelTypeConst.LLM, ollama_llm_model_credential), ModelTypeConst.LLM, ollama_llm_model_credential),
'baichuan2:13b-chat': ModelInfo(
'baichuan2:13b-chat',
'Baichuan 2 是百川智能推出的新一代开源大语言模型,采用 2.6 万亿 Tokens 的高质量语料训练,在权威的中文和英文 benchmark 上均取得同尺寸最好的效果',
ModelTypeConst.LLM, ollama_llm_model_credential),
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "web", "name": "web",
"version": "0.0.0", "version": "v1.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@ -37,6 +37,8 @@
</el-button> </el-button>
</div> </div>
<template #dropdown> <template #dropdown>
<el-scrollbar>
<div style="max-height: 400px">
<el-dropdown-menu> <el-dropdown-menu>
<template v-for="(item, index) in list" :key="index"> <template v-for="(item, index) in list" :key="index">
<div :class="item.id === id ? 'dropdown-active' : ''"> <div :class="item.id === id ? 'dropdown-active' : ''">
@ -79,13 +81,18 @@
</div> </div>
</template> </template>
<template v-else-if="isDataset"> <template v-else-if="isDataset">
<div class="w-full text-left cursor" @click="router.push({ path: '/dataset/create' })"> <div
class="w-full text-left cursor"
@click="router.push({ path: '/dataset/create' })"
>
<el-button link> <el-button link>
<el-icon class="mr-4"><Plus /></el-icon> <el-icon class="mr-4"><Plus /></el-icon>
</el-button> </el-button>
</div> </div>
</template> </template>
</div> </div>
</div>
</el-scrollbar>
</template> </template>
</el-dropdown> </el-dropdown>
</div> </div>

View File

@ -22,7 +22,9 @@
</el-scrollbar> </el-scrollbar>
<div class="text-right p-24 pt-0" v-if="problemId && isEdit"> <div class="text-right p-24 pt-0" v-if="problemId && isEdit">
<el-button @click.prevent="cancelEdit"> 取消 </el-button> <el-button @click.prevent="cancelEdit"> 取消 </el-button>
<el-button type="primary" :disabled="loading" @click="submitHandle"> 保存 </el-button> <el-button type="primary" :disabled="loading" @click="handleDebounceClick">
保存
</el-button>
</div> </div>
</el-col> </el-col>
<el-col :span="8" class="border-l"> <el-col :span="8" class="border-l">
@ -38,7 +40,9 @@
<template #footer v-if="!problemId"> <template #footer v-if="!problemId">
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click.prevent="dialogVisible = false"> 取消 </el-button> <el-button @click.prevent="dialogVisible = false"> 取消 </el-button>
<el-button :disabled="loading" type="primary" @click="submitHandle"> 提交 </el-button> <el-button :disabled="loading" type="primary" @click="handleDebounceClick">
提交
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -46,7 +50,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch, nextTick } from 'vue' import { ref, watch, nextTick } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { cloneDeep } from 'lodash' import { cloneDeep, debounce } from 'lodash'
import ParagraphForm from '@/views/paragraph/component/ParagraphForm.vue' import ParagraphForm from '@/views/paragraph/component/ParagraphForm.vue'
import ProblemComponent from '@/views/paragraph/component/ProblemComponent.vue' import ProblemComponent from '@/views/paragraph/component/ProblemComponent.vue'
import paragraphApi from '@/api/paragraph' import paragraphApi from '@/api/paragraph'
@ -108,8 +113,8 @@ const open = (data: any) => {
dialogVisible.value = true dialogVisible.value = true
} }
const submitHandle = async () => { const submitHandle = async () => {
loading.value = true
if (await paragraphFormRef.value?.validate()) { if (await paragraphFormRef.value?.validate()) {
loading.value = true
if (problemId.value) { if (problemId.value) {
paragraph paragraph
.asyncPutParagraph( .asyncPutParagraph(
@ -138,6 +143,9 @@ const submitHandle = async () => {
} }
} }
} }
const handleDebounceClick = debounce(() => {
submitHandle()
}, 200)
defineExpose({ open }) defineExpose({ open })
</script> </script>