Skip to content

Commit 01bb57f

Browse files
authored
Fix: increase buffer size for knowledge ingest process (#527)
Signed-off-by: Daishan Peng <[email protected]>
1 parent f6a8147 commit 01bb57f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

actions/knowledge/knowledge.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ export async function ingest(
2121
const knowledgeBinaryPath = process.env.KNOWLEDGE_BIN;
2222
const { stdout, stderr } = await execPromise(
2323
`${knowledgeBinaryPath} ingest --prune --dataset ${datasetID} ${dir.replace(/ /g, '\\ ')}`,
24-
{ env: { ...process.env, GPTSCRIPT_GATEWAY_API_KEY: token } }
24+
{
25+
env: { ...process.env, GPTSCRIPT_GATEWAY_API_KEY: token },
26+
maxBuffer: 100 * 1024 * 1024, // Increase buffer size to 100 MB
27+
}
2528
);
2629
const combinedOutput = stdout + stderr;
2730
console.log(`logs for ingesting dataset ${datasetID}: `, combinedOutput);
@@ -97,7 +100,7 @@ export async function ensureFiles(
97100
}
98101
}
99102

100-
return;
103+
return;
101104
}
102105

103106
export async function runKnowledgeIngest(
@@ -112,6 +115,7 @@ export async function runKnowledgeIngest(
112115
{
113116
cwd: path.join(KNOWLEDGE_DIR(), 'script_data', id),
114117
env: { ...process.env, GPTSCRIPT_GATEWAY_API_KEY: token },
118+
maxBuffer: 100 * 1024 * 1024, // Increase buffer size to 100 MB
115119
}
116120
);
117121
const combinedOutput = stdout + stderr;

0 commit comments

Comments
 (0)