- added copyTokenizers to util
- added workerpools to be copied over from core - import and execute copyTokenizers in prepackage-cross-plat
This commit is contained in:
parent
4c873ec095
commit
0bce1dc9c2
2 changed files with 20 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ const {
|
|||
copySqliteBinary,
|
||||
installNodeModuleInTempDirAndCopyToCurrent,
|
||||
downloadSqliteBinary,
|
||||
copyTokenizers,
|
||||
} = require("./utils");
|
||||
|
||||
// Clear folders that will be packaged to ensure clean slate
|
||||
|
|
@ -104,6 +105,9 @@ async function package(target, os, arch, exe) {
|
|||
// *** onnxruntime-node ***
|
||||
await copyOnnxRuntimeFromNodeModules(target);
|
||||
|
||||
// copy llama tokenizers to out
|
||||
copyTokenizers();
|
||||
|
||||
// *** Install @lancedb binary ***
|
||||
const lancePackageToInstall = {
|
||||
"darwin-arm64": "@lancedb/vectordb-darwin-arm64",
|
||||
|
|
|
|||
|
|
@ -39,6 +39,20 @@ function copyConfigSchema() {
|
|||
fs.writeFileSync("continue_rc_schema.json", JSON.stringify(schema, null, 2));
|
||||
}
|
||||
|
||||
function copyTokenizers() {
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, "../../../core/llm/llamaTokenizerWorkerPool.mjs"),
|
||||
path.join(__dirname, "../out/llamaTokenizerWorkerPool.mjs"),
|
||||
);
|
||||
console.log("[info] Copied llamaTokenizerWorkerPool");
|
||||
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, "../../../core/llm/llamaTokenizer.mjs"),
|
||||
path.join(__dirname, "../out/llamaTokenizer.mjs"),
|
||||
);
|
||||
console.log("[info] Copied llamaTokenizer");
|
||||
}
|
||||
|
||||
function installNodeModules() {
|
||||
// Make sure we are in the right directory
|
||||
if (!process.cwd().endsWith("vscode")) {
|
||||
|
|
@ -242,6 +256,7 @@ async function copyNodeModules() {
|
|||
"@esbuild",
|
||||
"@lancedb",
|
||||
"@vscode/ripgrep",
|
||||
"workerpool"
|
||||
];
|
||||
fs.mkdirSync("out/node_modules", { recursive: true });
|
||||
|
||||
|
|
@ -497,4 +512,5 @@ module.exports = {
|
|||
installNodeModuleInTempDirAndCopyToCurrent,
|
||||
downloadSqliteBinary,
|
||||
downloadRipgrepBinary,
|
||||
copyTokenizers
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue