mirror of
https://github.com/cocktailpeanut/dalai
synced 2025-02-14 20:14:29 +01:00
Merge branch 'main' of https://github.com/cocktailpeanut/dalai
This commit is contained in:
commit
0b89a59751
@ -107,7 +107,7 @@ You do NOT have to install all models, you can install one by one. Let's take a
|
||||
|
||||
## Mac
|
||||
|
||||
### Step 1. Install node.js
|
||||
### Step 1. Install Node.js >=18
|
||||
|
||||
<a href="https://nodejs.org/en/download/" class='btn'>Install Node.js</a>
|
||||
|
||||
@ -212,13 +212,13 @@ npx dalai llama install 7B 13B
|
||||
|
||||
### Step 2.2. Troubleshoot (optional)
|
||||
|
||||
In case above steps fail, try installing node.js and python separately.
|
||||
In case above steps fail, try installing Node.js and Python separately.
|
||||
|
||||
Install Python:
|
||||
|
||||
<a href="https://www.python.org/ftp/python/3.10.10/python-3.10.10-embed-amd64.zip" class='btn'>Download Python</a>
|
||||
|
||||
Install Node.js:
|
||||
Install Node.js >= 18:
|
||||
|
||||
<a href="https://nodejs.org/en/download/" class='btn'>Download Node.js</a>
|
||||
|
||||
|
7
index.js
7
index.js
@ -19,6 +19,7 @@ const shell = platform === 'win32' ? 'powershell.exe' : 'bash';
|
||||
const L = require("./llama")
|
||||
const A = require("./alpaca")
|
||||
const exists = s => new Promise(r=>fs.access(s, fs.constants.F_OK, e => r(!e)))
|
||||
const escapeDoubleQuotes = (platform, arg) => platform === 'win32' ? arg.replace(/"/g, '`"') : arg.replace(/"/g, '\\"')
|
||||
class Dalai {
|
||||
constructor(home) {
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -180,9 +181,11 @@ class Dalai {
|
||||
|
||||
let chunks = []
|
||||
for(let key in o) {
|
||||
chunks.push(`--${key} ${o[key]}`)
|
||||
chunks.push(`--${key} ${escapeDoubleQuotes(platform, o[key].toString())}`)
|
||||
}
|
||||
chunks.push(`-p "${req.prompt}"`)
|
||||
const prompt = `"${escapeDoubleQuotes(platform, req.prompt)}"`
|
||||
|
||||
chunks.push(`-p ${prompt}`)
|
||||
|
||||
const main_bin_path = platform === "win32" ? path.resolve(this.home, Core, "build", "Release", "llama") : path.resolve(this.home, Core, "main")
|
||||
if (req.full) {
|
||||
|
Loading…
Reference in New Issue
Block a user