feat: add explicit managed model download sources
Managed speech and OCR downloads previously used catalog-specific source URLs without a global selection. Platform Features now lets users choose ModelScope by default or Hugging Face, while Main validates and freezes that source for each download. Verified coverage remains explicit: downloads never mix artifacts or silently switch sources, and installed models plus ZIP imports stay source-independent. Release note: 可在“设置 → 平台功能 → 通用设置”中选择 ModelScope 或 Hugging Face 作为后续语音输入与 OCR 模型下载源;缺少完整已验证文件或下载失败时不会静默换源。
This commit is contained in:
+11
-4
@@ -72,6 +72,7 @@ import type {
|
||||
import type {
|
||||
ApplicationSettings,
|
||||
ApplicationSettingsUpdate,
|
||||
ModelDownloadSource,
|
||||
VersionCheckResult
|
||||
} from '../shared/application-settings-contracts'
|
||||
import type { ReleaseNotesSnapshot } from '../shared/release-notes-contracts'
|
||||
@@ -404,10 +405,13 @@ const desktopApi: DesktopApi = {
|
||||
ipcRenderer.invoke(
|
||||
ipcChannels.speechModelsGet
|
||||
) as Promise<SpeechModelSnapshot>,
|
||||
install: (modelId: string) =>
|
||||
install: (
|
||||
modelId: string,
|
||||
expectedDownloadSource: ModelDownloadSource
|
||||
) =>
|
||||
ipcRenderer.invoke(
|
||||
ipcChannels.speechModelsInstall,
|
||||
{ modelId }
|
||||
{ modelId, expectedDownloadSource }
|
||||
) as Promise<SpeechModelSnapshot>,
|
||||
cancel: (modelId: string) =>
|
||||
ipcRenderer.invoke(
|
||||
@@ -481,10 +485,13 @@ const desktopApi: DesktopApi = {
|
||||
ipcChannels.documentParsingTest,
|
||||
{ purpose }
|
||||
) as Promise<DocumentParsingDiagnostic | undefined>,
|
||||
installOcrModel: (modelId: string) =>
|
||||
installOcrModel: (
|
||||
modelId: string,
|
||||
expectedDownloadSource: ModelDownloadSource
|
||||
) =>
|
||||
ipcRenderer.invoke(
|
||||
ipcChannels.documentOcrModelsInstall,
|
||||
{ modelId }
|
||||
{ modelId, expectedDownloadSource }
|
||||
) as Promise<DocumentParsingSnapshot>,
|
||||
cancelOcrModelOperation: (modelId: string) =>
|
||||
ipcRenderer.invoke(
|
||||
|
||||
Reference in New Issue
Block a user