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.home = path.resolve(this.root.home, "alpaca")
|
||||
this.url = "https://github.com/cocktailpeanut/alpaca.cpp.git"
|
||||
this.launcher = {
|
||||
win32: "chat",
|
||||
linux: "chat",
|
||||
darwin: "chat",
|
||||
}
|
||||
}
|
||||
async make() {
|
||||
let success
|
||||
@ -25,10 +20,12 @@ win32: "chat",
|
||||
const cmake_path = path.join(venv_path, "Scripts", "cmake")
|
||||
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(`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 {
|
||||
// Make on linux + mac
|
||||
success = await this.root.exec(`make chat`, this.home)
|
||||
success = await this.root.exec(`make`, this.home)
|
||||
if (!success) {
|
||||
throw new Error("running 'make' failed")
|
||||
return
|
||||
|
@ -115,7 +115,7 @@ const config = {
|
||||
n_predict: 200,
|
||||
top_k: 40,
|
||||
top_p: 0.9,
|
||||
temp: 0.8,
|
||||
temp: 0.1,
|
||||
repeat_last_n: 64,
|
||||
repeat_penalty: 1.3,
|
||||
debug: false,
|
||||
|
2
index.js
2
index.js
@ -147,7 +147,7 @@ class Dalai {
|
||||
}
|
||||
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) {
|
||||
await this.exec(`${main_bin_path} ${chunks.join(" ")}`, this.cores[Core].home, cb)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user