1
mirror of https://github.com/cocktailpeanut/dalai synced 2025-02-14 20:14:29 +01:00
This commit is contained in:
cocktailpeanut 2023-03-18 01:38:52 -04:00
commit 0b89a59751
2 changed files with 8 additions and 5 deletions

View File

@ -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>

View File

@ -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) {