mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-05-09 00:20:09 +00:00
更新嵌入管理器以支持 GPU 加速,调整批处理大小,优化内容处理逻辑,并添加获取数据库最大修改时间的功能以提高文件索引效率。同时修复了向量管理器中的类型问题,确保模型加载和嵌入过程的稳定性。
This commit is contained in:
@@ -48,7 +48,7 @@ async function loadTransformers() {
|
||||
env.allowRemoteModels = true;
|
||||
|
||||
// 配置 WASM 后端 - 修复线程配置
|
||||
env.backends.onnx.wasm.numThreads = 4; // 在 Worker 中使用单线程,避免竞态条件
|
||||
env.backends.onnx.wasm.numThreads = 1; // 在 Worker 中使用单线程,避免竞态条件
|
||||
env.backends.onnx.wasm.simd = true;
|
||||
|
||||
// 禁用 Node.js 特定功能
|
||||
@@ -201,7 +201,7 @@ async function embedBatch(inputs: EmbedInput[]): Promise<EmbedResult[]> {
|
||||
}
|
||||
|
||||
// 批处理大小(可以根据需要调整)
|
||||
const batchSize = 1;
|
||||
const batchSize = 8;
|
||||
|
||||
if (filteredInputs.length > batchSize) {
|
||||
console.log(`Processing ${filteredInputs.length} inputs in batches of ${batchSize}`);
|
||||
|
||||
Reference in New Issue
Block a user