fix: streamline document parsing settings

This commit is contained in:
lofyer
2026-08-13 00:08:15 +08:00
parent d33df979da
commit 86b63406c2
21 changed files with 1160 additions and 509 deletions
+12 -1
View File
@@ -205,7 +205,18 @@ export class DocumentOcrModelManager {
async getStatus(
modelId: string
): Promise<ReturnType<typeof documentParsingModelStatusSchema.parse>> {
const entry = this.requireCatalogEntry(modelId)
const id = localOcrModelIdSchema.parse(modelId)
const entry = this.catalog.find((candidate) => candidate.id === id)
if (!entry) {
return documentParsingModelStatusSchema.parse({
id,
displayName: id,
available: false,
verified: false,
runtime: 'onnxruntime-web-wasm',
detail: '当前版本不再提供此 OCR 模型,请选择其他模型'
})
}
try {
await this.getVerifiedStatus(entry)
return documentParsingModelStatusSchema.parse({