midyf model_id
This commit is contained in:
parent
575b04c10f
commit
541369d343
@ -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类型的文档,保存基本信息,不处理段落
|
||||
# 段落处理将通过异步任务进行
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user