midyf model_id
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
朱潮 2025-08-26 18:43:44 +08:00
parent 575b04c10f
commit 541369d343
3 changed files with 25 additions and 6 deletions

View File

@ -1165,13 +1165,14 @@ class DocumentSerializers(serializers.Serializer):
import os
for document in instance_list:
# 检查是否是MinerU类型的文档通过llm_model_id或vision_model_id判断
# 检查是否是MinerU类型的文档需要同时有llm_model_id和vision_model_id
llm_model_id = document.get('llm_model_id')
vision_model_id = document.get('vision_model_id')
maxkb_logger.info(f"Processing document: {document.get('name')}, llm_model_id: {llm_model_id}, vision_model_id: {vision_model_id}")
if llm_model_id or vision_model_id:
# 只有同时提供两个模型ID时才是高级学习文档
if llm_model_id and vision_model_id:
maxkb_logger.info(f"Document {document.get('name')} is MinerU type, will process asynchronously")
# MinerU类型的文档保存基本信息不处理段落
# 段落处理将通过异步任务进行

View File

@ -150,6 +150,11 @@ const prev = () => {
function clearStore() {
knowledge.saveDocumentsFile([])
knowledge.saveDocumentsType('')
// MinerU
knowledge.saveMinerUModels({
llmModel: null,
visionModel: null
})
}
function submit() {
loading.value = true
@ -165,10 +170,13 @@ function submit() {
paragraphs: item.content,
source_file_id: item.source_file_id,
}
// MinerU
if (documentsType.value === 'mineru' && knowledge.mineruModels) {
doc.llm_model_id = knowledge.mineruModels.llmModel
doc.vision_model_id = knowledge.mineruModels.visionModel
// MinerU
if (documentsType.value === 'mineru') {
//
if (knowledge.mineruModels && knowledge.mineruModels.llmModel && knowledge.mineruModels.visionModel) {
doc.llm_model_id = knowledge.mineruModels.llmModel
doc.vision_model_id = knowledge.mineruModels.visionModel
}
//
if (SetRulesRef.value?.form?.patterns) {
doc.split_patterns = SetRulesRef.value.form.patterns

View File

@ -385,6 +385,16 @@ function downloadTableTemplate(type: string) {
function radioChange() {
form.value.fileList = []
// mineru
if (form.value.fileType !== 'mineru') {
form.value.llmModel = null
form.value.visionModel = null
// store
knowledge.saveMinerUModels({
llmModel: null,
visionModel: null
})
}
}
function deleteFile(index: number) {