Skip to content

Commit

Permalink
ensure that git succeeds one way or another
Browse files Browse the repository at this point in the history
  • Loading branch information
cocktailpeanut committed Mar 19, 2023
1 parent 938c50e commit 91a75f6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
20 changes: 18 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ Python must be 3.10 or below (pytorch and other libraries are not supported yet

---

### Step 2. Install models
### Step 2.1. Install models

Currently supported engines are `llama` and `alpaca`.

Expand Down Expand Up @@ -331,8 +331,24 @@ or to download multiple models:
npx dalai llama install 7B 13B
```

### Step 2.2. Troubleshoot

In case the model install silently fails or hangs forever, try the following command, and try running the npx command again:

On ubuntu/debian/etc.:

```
sueo apt-get install build-essential python3-venv -y
```

### Step 4. Run Web UI
On fedora/etc.:

```
dnf install make automake gcc gcc-c++ kernel-devel python3-virtualenv -y
```


### Step 3. Run Web UI

After everything has been installed, run the following command to launch the web UI server:

Expand Down
17 changes: 11 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,18 @@ class Dalai {
await fs.promises.mkdir(path.resolve(engine.home), { recursive: true }).catch((e) => {
console.log("ERROR" ,e)
})
if (e) {

try {
console.log("try fetching", engine.home, engine.url)
await git.fetch({ fs, http, dir: engine.home, url: engine.url })
} else {
console.log("try cloning", engine.home, engine.url)
// await fs.promises.mkdir(engine.home, { recursive: true }).catch((e) => { })
await git.clone({ fs, http, dir: engine.home, url: engine.url })
await git.pull({ fs, http, dir: engine.home, url: engine.url })
} catch (e) {
console.log("[E] Pull", e)
try {
console.log("try cloning", engine.home, engine.url)
await git.clone({ fs, http, dir: engine.home, url: engine.url })
} catch (e2) {
console.log("[E] Clone", e2)
}
}
console.log("next", core, engine.make);
/**************************************************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dalai",
"version": "0.2.42",
"version": "0.2.45",
"description": "",
"main": "index.js",
"author": "cocktailpeanut",
Expand Down

0 comments on commit 91a75f6

Please sign in to comment.