Skip to content

Commit

Permalink
Simplify examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Jun 16, 2023
1 parent 7f60fe7 commit 995b07d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 44 deletions.
19 changes: 6 additions & 13 deletions examples/get-started/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
# WebLLM Get Started App

This folder provides a minimum demo to show WebLLM API in a webapp setting.
To try it out, you can do the following steps
To try it out, you can do the following steps under this folder

- Modify [package.json](package.json) to make sure either
- `@mlc-ai/web-llm` points to a valid npm version e.g.
```js
"dependencies": {
"@mlc-ai/web-llm": "^0.2.0"
}
```
```bash
npm install
npm start
```
```bash
npm install
npm start
```

Note if you would like to hack WebLLM core package.
You keep the dependencies as `"file:../.."`, and follow the build from source
You can change web-llm dependencies as `"file:../.."`, and follow the build from source
instruction in the project to build webllm locally. This option is only recommended
if you would like to hack WebLLM core package.
8 changes: 5 additions & 3 deletions examples/get-started/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
"build": "parcel build src/get_started.html --dist-dir lib"
},
"devDependencies": {
"buffer": "^5.7.1",
"parcel": "^2.8.3",
"typescript": "^4.9.5",
"tslib": "^2.3.1"
"process": "^0.11.10",
"tslib": "^2.3.1",
"typescript": "^4.9.5"
},
"dependencies": {
"@mlc-ai/web-llm": "file:../.."
"@mlc-ai/web-llm": "^0.2.1"
}
}
20 changes: 9 additions & 11 deletions examples/simple-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

This folder provides a complete implementation of a simple
chat app based on WebLLM. To try it out, you can do the following steps
under this folder

- Modify [package.json](package.json) to make sure
- `@mlc-ai/web-llm` points to a valid npm version e.g.
```js
"dependencies": {
"@mlc-ai/web-llm": "^0.2.0"
}
```
```bash
npm install
npm start
```

```bash
npm install
npm start
```
Note if you would like to hack WebLLM core package.
You can change web-llm dependencies as `"file:../.."`, and follow the build from source
instruction in the project to build webllm locally. This option is only recommended
if you would like to hack WebLLM core package.
2 changes: 1 addition & 1 deletion examples/simple-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"typescript": "^4.9.5"
},
"dependencies": {
"@mlc-ai/web-llm": "file:../.."
"@mlc-ai/web-llm": "^0.2.1"
}
}
22 changes: 9 additions & 13 deletions examples/web-worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ This folder provides a minimum demo to show WebLLM API using
The main benefit of web worker is that all ML workloads runs on a separate thread as a result
will less likely block the UI.

To try it out, you can do the following steps
To try it out, you can do the following steps under this folder

- Modify [package.json](package.json) to make sure either
- `@mlc-ai/web-llm` points to a valid npm version e.g.
```js
"dependencies": {
"@mlc-ai/web-llm": "^0.2.0"
}
```
Try this option if you would like to use WebLLM without building it yourself.
```bash
npm install
npm start
```

```bash
npm install
npm start
```
Note if you would like to hack WebLLM core package.
You can change web-llm dependencies as `"file:../.."`, and follow the build from source
instruction in the project to build webllm locally. This option is only recommended
if you would like to hack WebLLM core package.
8 changes: 5 additions & 3 deletions examples/web-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
"build": "parcel build src/get_started.html --dist-dir lib"
},
"devDependencies": {
"buffer": "^6.0.3",
"parcel": "^2.8.3",
"typescript": "^4.9.5",
"tslib": "^2.3.1"
"process": "^0.11.10",
"tslib": "^2.3.1",
"typescript": "^4.9.5"
},
"dependencies": {
"@mlc-ai/web-llm": "file:../.."
"@mlc-ai/web-llm": "^0.2.1"
}
}

0 comments on commit 995b07d

Please sign in to comment.