基于 Electron + Vue3 + TypeScript + LanceDB 的本地化 RAG 问答桌面应用。 仅支持 Linux(Kylin V10 / Ubuntu),适配 ER160(揽月 M50 NPU)和 ER25(芯动力 RPP)计算卡。 服务进程管理委托给 er_backend(HTTP 17700),前端专注 RAG 逻辑与用户交互。 包含: - src/elec_rag_ui 前端工程(Electron + Vue3) - models/ 本地嵌入模型(bge-small/base/large,ASR,标点恢复,onnx 文件由 Git LFS 管理) - docs/ 示例文档(用于测试索引与问答)
15 lines
598 B
JavaScript
15 lines
598 B
JavaScript
// Stub for sharp. This app only uses text embeddings — image processing is never called.
|
|
// @huggingface/transformers checks `if (sharp_default)` at module init; returning a
|
|
// callable truthy value satisfies that check without loading any native binary.
|
|
function sharpStub(input, options) {
|
|
const self = {
|
|
metadata: async () => ({ channels: 3, width: 0, height: 0 }),
|
|
rotate: () => self,
|
|
raw: () => self,
|
|
toBuffer: async () => ({ data: Buffer.alloc(0), info: { width: 0, height: 0, channels: 3 } })
|
|
}
|
|
return self
|
|
}
|
|
sharpStub.default = sharpStub
|
|
module.exports = sharpStub
|