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