mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
Merge branch 'main' of github.com:maxkb-dev/maxkb
This commit is contained in:
commit
4589555af6
|
|
@ -82,6 +82,10 @@ model_dict = {
|
|||
'llama2-chinese:13b-maxkb',
|
||||
'由于Llama2本身的中文对齐较弱,我们采用中文指令集,对meta-llama/Llama-2-13b-chat-hf进行LoRA微调,使其具备较强的中文对话能力。fi2cloud专用',
|
||||
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),
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "web",
|
||||
"version": "0.0.0",
|
||||
"version": "v1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
|
|
|||
|
|
@ -37,55 +37,62 @@
|
|||
</el-button>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<template v-for="(item, index) in list" :key="index">
|
||||
<div :class="item.id === id ? 'dropdown-active' : ''">
|
||||
<el-dropdown-item :command="item.id">
|
||||
<div class="flex align-center">
|
||||
<AppAvatar
|
||||
v-if="isApplication"
|
||||
:name="item.name"
|
||||
pinyinColor
|
||||
class="mr-12"
|
||||
shape="square"
|
||||
:size="24"
|
||||
/>
|
||||
<AppAvatar
|
||||
v-else-if="isDataset && item.type === '1'"
|
||||
class="mr-12 avatar-purple"
|
||||
shape="square"
|
||||
:size="24"
|
||||
>
|
||||
<img src="@/assets/icon_web.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar v-else class="mr-12" shape="square" :size="24">
|
||||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<span class="ellipsis"> {{ item?.name }}</span>
|
||||
<el-scrollbar>
|
||||
<div style="max-height: 400px">
|
||||
<el-dropdown-menu>
|
||||
<template v-for="(item, index) in list" :key="index">
|
||||
<div :class="item.id === id ? 'dropdown-active' : ''">
|
||||
<el-dropdown-item :command="item.id">
|
||||
<div class="flex align-center">
|
||||
<AppAvatar
|
||||
v-if="isApplication"
|
||||
:name="item.name"
|
||||
pinyinColor
|
||||
class="mr-12"
|
||||
shape="square"
|
||||
:size="24"
|
||||
/>
|
||||
<AppAvatar
|
||||
v-else-if="isDataset && item.type === '1'"
|
||||
class="mr-12 avatar-purple"
|
||||
shape="square"
|
||||
:size="24"
|
||||
>
|
||||
<img src="@/assets/icon_web.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar v-else class="mr-12" shape="square" :size="24">
|
||||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<span class="ellipsis"> {{ item?.name }}</span>
|
||||
</div>
|
||||
</el-dropdown-item>
|
||||
</div>
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
</el-dropdown-menu>
|
||||
<div class="breadcrumb__footer border-t" style="padding: 8px 11px; min-width: 200px">
|
||||
<template v-if="isApplication">
|
||||
<div
|
||||
class="w-full text-left cursor"
|
||||
@click="router.push({ path: '/application/create' })"
|
||||
>
|
||||
<el-button link>
|
||||
<el-icon class="mr-4"><Plus /></el-icon> 创建应用
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="isDataset">
|
||||
<div
|
||||
class="w-full text-left cursor"
|
||||
@click="router.push({ path: '/dataset/create' })"
|
||||
>
|
||||
<el-button link>
|
||||
<el-icon class="mr-4"><Plus /></el-icon> 创建知识库
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</el-dropdown-menu>
|
||||
<div class="breadcrumb__footer border-t" style="padding: 8px 11px; min-width: 200px">
|
||||
<template v-if="isApplication">
|
||||
<div
|
||||
class="w-full text-left cursor"
|
||||
@click="router.push({ path: '/application/create' })"
|
||||
>
|
||||
<el-button link>
|
||||
<el-icon class="mr-4"><Plus /></el-icon> 创建应用
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="isDataset">
|
||||
<div class="w-full text-left cursor" @click="router.push({ path: '/dataset/create' })">
|
||||
<el-button link>
|
||||
<el-icon class="mr-4"><Plus /></el-icon> 创建知识库
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@
|
|||
</el-scrollbar>
|
||||
<div class="text-right p-24 pt-0" v-if="problemId && isEdit">
|
||||
<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>
|
||||
</el-col>
|
||||
<el-col :span="8" class="border-l">
|
||||
|
|
@ -38,7 +40,9 @@
|
|||
<template #footer v-if="!problemId">
|
||||
<span class="dialog-footer">
|
||||
<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>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
|
@ -46,7 +50,8 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch, nextTick } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { cloneDeep, debounce } from 'lodash'
|
||||
|
||||
import ParagraphForm from '@/views/paragraph/component/ParagraphForm.vue'
|
||||
import ProblemComponent from '@/views/paragraph/component/ProblemComponent.vue'
|
||||
import paragraphApi from '@/api/paragraph'
|
||||
|
|
@ -108,8 +113,8 @@ const open = (data: any) => {
|
|||
dialogVisible.value = true
|
||||
}
|
||||
const submitHandle = async () => {
|
||||
loading.value = true
|
||||
if (await paragraphFormRef.value?.validate()) {
|
||||
loading.value = true
|
||||
if (problemId.value) {
|
||||
paragraph
|
||||
.asyncPutParagraph(
|
||||
|
|
@ -138,6 +143,9 @@ const submitHandle = async () => {
|
|||
}
|
||||
}
|
||||
}
|
||||
const handleDebounceClick = debounce(() => {
|
||||
submitHandle()
|
||||
}, 200)
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue