Skip to content

Commit 2d088ea

Browse files
authored
improve model selector (#107)
1. clear all chat history when switching model 2. ban user input model url temporarily
1 parent e1e2e0a commit 2d088ea

File tree

4 files changed

+25
-24
lines changed

4 files changed

+25
-24
lines changed

site/_includes/llm_chat.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@
2222
}
2323
}
2424
</script>
25-
<!--
25+
2626
<form>
27-
<select id="model-name">
28-
<option selected="selected">vicuna-v1-7b-q4f32_0</option>
29-
<option >RedPajama-INCITE-Chat-3B-v1-q4f32_0</option>
27+
<select id="model">
28+
<option >vicuna-v1-7b-q4f32_0</option>
29+
<option selected="selected">RedPajama-INCITE-Chat-3B-v1-q4f32_0</option>
3030
</select>
31-
</form> -->
31+
</form>
3232

33-
<label>Pick a pre-compiled model or load your own model's mlc-chat-config.json:
33+
<!-- <label>Pick a pre-compiled model or load your own model's mlc-chat-config.json:
3434
<input list="model-names" name="model" id="model"/></label>
3535
<datalist id="model-names">
3636
<option value="vicuna-v1-7b-q4f32_0" ></option>
3737
<option value="RedPajama-INCITE-Chat-3B-v1-q4f32_0"></option>
38-
</datalist>
38+
</datalist> -->
3939

4040
<script src="dist/llm_chat.js"></script>
4141
<link href="dist/llm_chat.css" rel="stylesheet" type="text/css"/>

site/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ Won’t it be even more amazing if we can simply open up a browser and directly
2222

2323
## Instructions
2424

25-
WebGPU just shipped to Chrome and is in beta. We do our experiments in [Chrome Canary](https://www.google.com/chrome/canary/). You can also try out the latest Chrome 113. Chrome version ≤ 112 is not supported, and if you are using it, the demo will raise an error like `Find an error initializing the WebGPU device OperationError: Required limit (1073741824) is greater than the supported limit (268435456). - While validating maxBufferSize - While validating required limits.`
26-
We have tested it on windows and mac, you will need a gpu with about 6.4G memory.
25+
WebGPU just shipped to Chrome. You can try out the latest Chrome 113. Chrome version ≤ 112 is not supported, and if you are using it, the demo will raise an error like `Find an error initializing the WebGPU device OperationError: Required limit (1073741824) is greater than the supported limit (268435456). - While validating maxBufferSize - While validating required limits.`
26+
We have tested it on Windows and Mac, you will need a GPU with about 6GB memory to run Vicuna-7B and about 3GB memory to run RedPajama-3B.
2727

2828
If you have a Mac computer with Apple silicon, here are the instructions for you to run the chatbot demo on your browser locally:
2929

30-
- Install [Chrome Canary](https://www.google.com/chrome/canary/), a developer version of Chrome that enables the use of WebGPU.
31-
- Launch Chrome Canary. You are recommended to launch from terminal with the following command (or replace Chrome Canary with Chrome):
30+
- Upgrade Chrome to version ≥ 113.
31+
- Launch Chrome. You are recommended to launch from terminal with the following command:
3232
```
33-
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --enable-dawn-features=disable_robustness
33+
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --enable-dawn-features=disable_robustness
3434
```
35-
This command turns off the robustness check from Chrome Canary that slows down chatbot reply to times. It is not necessary, but we strongly recommend you to start Chrome with this command.
36-
- Enter your inputs, click “Send” – we are ready to go! The chat bot will first fetch model parameters into local cache. The download may take a few minutes, only for the first run. The subsequent refreshes and runs will be faster.
35+
This command turns off the robustness check from Chrome that slows down chatbot reply to times. It is not necessary, but we strongly recommend you to start Chrome with this command.
36+
- Select the model you want to try out. Enter your inputs, click “Send” – we are ready to go! The chat bot will first fetch model parameters into local cache. The download may take a few minutes, only for the first run. The subsequent refreshes and runs will be faster.
3737

3838
## Chat Demo
3939

40-
The chat demo is based on [vicuna-7b-v1.1](https://huggingface.co/lmsys/vicuna-7b-delta-v1.1) model and [RedPajama-INCITE-Chat-3B-v1](https://huggingface.co/togethercomputer/RedPajama-INCITE-Chat-3B-v1) model . More model support are on the way.
40+
The chat demo is based on [vicuna-7b-v1.1](https://huggingface.co/lmsys/vicuna-7b-delta-v1.1) model and [RedPajama-INCITE-Chat-3B-v1](https://huggingface.co/togethercomputer/RedPajama-INCITE-Chat-3B-v1) model. More model supports are on the way.
4141

4242
{% include llm_chat.html %}
4343

@@ -48,4 +48,4 @@ The chat demo is based on [vicuna-7b-v1.1](https://huggingface.co/lmsys/vicuna-7
4848

4949
## Disclaimer
5050

51-
This demo site is for research purposes only, subject to the model License of LLaMA and Vicuna. Please contact us if you find any potential violation.
51+
This demo site is for research purposes only, subject to the model License of LLaMA, Vicuna and RedPajama. Please contact us if you find any potential violation.

web/llm_chat.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@
2222
}
2323
}
2424
</script>
25-
<!--
25+
2626
<form>
27-
<select id="model-name">
28-
<option selected="selected">vicuna-v1-7b-q4f32_0</option>
29-
<option >RedPajama-INCITE-Chat-3B-v1-q4f32_0</option>
27+
<select id="model">
28+
<option >vicuna-v1-7b-q4f32_0</option>
29+
<option selected="selected">RedPajama-INCITE-Chat-3B-v1-q4f32_0</option>
3030
</select>
31-
</form> -->
31+
</form>
3232

33-
<label>Pick a pre-compiled model or load your own model's mlc-chat-config.json:
33+
<!-- <label>Pick a pre-compiled model or load your own model's mlc-chat-config.json:
3434
<input list="model-names" name="model" id="model"/></label>
3535
<datalist id="model-names">
3636
<option value="vicuna-v1-7b-q4f32_0" ></option>
3737
<option value="RedPajama-INCITE-Chat-3B-v1-q4f32_0"></option>
38-
</datalist>
38+
</datalist> -->
3939

4040
<script src="dist/llm_chat.js"></script>
4141
<link href="dist/llm_chat.css" rel="stylesheet" type="text/css"/>

web/llm_chat.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,11 +494,12 @@ class LLMChatInstance {
494494
this.uiChatInput = undefined;
495495
this.logger = console.log;
496496
this.debugTest = false;
497-
this.model = "vicuna-v1-7b-q4f32_0";
497+
this.model = "RedPajama-INCITE-Chat-3B-v1-q4f32_0";
498498

499499
}
500500

501501
reboot() {
502+
this.resetChat();
502503
this.config = undefined;
503504
this.pipeline = undefined;
504505
if (this.tvm !== undefined) {

0 commit comments

Comments
 (0)