mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 05:09:09 +08:00
refactor(语言检测): 移除翻译模型依赖,改用快速或默认模型
This commit is contained in:
parent
a21fc91915
commit
748d342b17
@ -65,8 +65,7 @@ import {
|
|||||||
getDefaultAssistant,
|
getDefaultAssistant,
|
||||||
getDefaultModel,
|
getDefaultModel,
|
||||||
getProviderByModel,
|
getProviderByModel,
|
||||||
getQuickModel,
|
getQuickModel
|
||||||
getTranslateModel
|
|
||||||
} from './AssistantService'
|
} from './AssistantService'
|
||||||
import { processKnowledgeSearch } from './KnowledgeService'
|
import { processKnowledgeSearch } from './KnowledgeService'
|
||||||
import { MemoryProcessor } from './MemoryProcessor'
|
import { MemoryProcessor } from './MemoryProcessor'
|
||||||
@ -621,14 +620,13 @@ export async function fetchLanguageDetection({ text, onResponse }: FetchLanguage
|
|||||||
const listLang = translateLanguageOptions.map((item) => item.langCode)
|
const listLang = translateLanguageOptions.map((item) => item.langCode)
|
||||||
const listLangText = JSON.stringify(listLang)
|
const listLangText = JSON.stringify(listLang)
|
||||||
|
|
||||||
let model = getTranslateModel()
|
const model = getQuickModel() || getDefaultModel()
|
||||||
if (!model) {
|
if (!model) {
|
||||||
throw new Error(i18n.t('error.model.not_exists'))
|
throw new Error(i18n.t('error.model.not_exists'))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isQwenMTModel(model)) {
|
if (isQwenMTModel(model)) {
|
||||||
logger.info('QwenMT cannot be used for language detection. Fallback to default model.')
|
logger.info('QwenMT cannot be used for language detection.')
|
||||||
model = getDefaultModel()
|
|
||||||
if (isQwenMTModel(model)) {
|
if (isQwenMTModel(model)) {
|
||||||
throw new Error(i18n.t('translate.error.detect.qwen_mt'))
|
throw new Error(i18n.t('translate.error.detect.qwen_mt'))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user