mirror of
https://github.com/cocktailpeanut/dalai
synced 2024-11-20 23:07:32 +01:00
windows fix
This commit is contained in:
parent
d15b1a4770
commit
a32b544014
11
alpaca.js
11
alpaca.js
@ -11,11 +11,6 @@ class Alpaca {
|
|||||||
this.root = root
|
this.root = root
|
||||||
this.home = path.resolve(this.root.home, "alpaca")
|
this.home = path.resolve(this.root.home, "alpaca")
|
||||||
this.url = "https://github.com/cocktailpeanut/alpaca.cpp.git"
|
this.url = "https://github.com/cocktailpeanut/alpaca.cpp.git"
|
||||||
this.launcher = {
|
|
||||||
win32: "chat",
|
|
||||||
linux: "chat",
|
|
||||||
darwin: "chat",
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
async make() {
|
async make() {
|
||||||
let success
|
let success
|
||||||
@ -25,10 +20,12 @@ win32: "chat",
|
|||||||
const cmake_path = path.join(venv_path, "Scripts", "cmake")
|
const cmake_path = path.join(venv_path, "Scripts", "cmake")
|
||||||
await this.root.exec("mkdir build", this.home)
|
await this.root.exec("mkdir build", this.home)
|
||||||
await this.root.exec(`Remove-Item -path ${path.resolve(this.home, "build", "CMakeCache.txt")}`, this.home)
|
await this.root.exec(`Remove-Item -path ${path.resolve(this.home, "build", "CMakeCache.txt")}`, this.home)
|
||||||
await this.root.exec(`make chat`, this.home)
|
//await this.root.exec(`${cmake_path} chat`, this.home)
|
||||||
|
await this.root.exec(`${cmake_path} ..`, path.resolve(this.home, "build"))
|
||||||
|
await this.root.exec(`${cmake_path} --build . --config Release`, path.resolve(this.home, "build"))
|
||||||
} else {
|
} else {
|
||||||
// Make on linux + mac
|
// Make on linux + mac
|
||||||
success = await this.root.exec(`make chat`, this.home)
|
success = await this.root.exec(`make`, this.home)
|
||||||
if (!success) {
|
if (!success) {
|
||||||
throw new Error("running 'make' failed")
|
throw new Error("running 'make' failed")
|
||||||
return
|
return
|
||||||
|
@ -115,7 +115,7 @@ const config = {
|
|||||||
n_predict: 200,
|
n_predict: 200,
|
||||||
top_k: 40,
|
top_k: 40,
|
||||||
top_p: 0.9,
|
top_p: 0.9,
|
||||||
temp: 0.8,
|
temp: 0.1,
|
||||||
repeat_last_n: 64,
|
repeat_last_n: 64,
|
||||||
repeat_penalty: 1.3,
|
repeat_penalty: 1.3,
|
||||||
debug: false,
|
debug: false,
|
||||||
|
2
index.js
2
index.js
@ -147,7 +147,7 @@ class Dalai {
|
|||||||
}
|
}
|
||||||
chunks.push(`-p "${req.prompt}"`)
|
chunks.push(`-p "${req.prompt}"`)
|
||||||
|
|
||||||
const main_bin_path = platform === "win32" ? path.resolve(this.home, Core, "build", "Release", this.cores[Core].launcher[platform]) : path.resolve(this.home, Core, this.cores[Core].launcher[platform])
|
const main_bin_path = platform === "win32" ? path.resolve(this.home, Core, "build", "Release", "llama") : path.resolve(this.home, Core, "main")
|
||||||
if (req.full) {
|
if (req.full) {
|
||||||
await this.exec(`${main_bin_path} ${chunks.join(" ")}`, this.cores[Core].home, cb)
|
await this.exec(`${main_bin_path} ${chunks.join(" ")}`, this.cores[Core].home, cb)
|
||||||
} else {
|
} else {
|
||||||
|
5
llama.js
5
llama.js
@ -11,11 +11,6 @@ class LLaMA {
|
|||||||
this.root = root
|
this.root = root
|
||||||
this.home = path.resolve(this.root.home, "llama")
|
this.home = path.resolve(this.root.home, "llama")
|
||||||
this.url = "https://github.com/ggerganov/llama.cpp.git"
|
this.url = "https://github.com/ggerganov/llama.cpp.git"
|
||||||
this.launcher = {
|
|
||||||
win32: "llama",
|
|
||||||
linux: "main",
|
|
||||||
darwin: "main"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
async make() {
|
async make() {
|
||||||
console.log("make")
|
console.log("make")
|
||||||
|
Loading…
Reference in New Issue
Block a user