diff --git a/examples/server/README.md b/examples/server/README.md index 0751b9612..2c4e4f3b8 100644 --- a/examples/server/README.md +++ b/examples/server/README.md @@ -369,3 +369,16 @@ You can use html formatting if needed. ``` + + +### Updating Custom Prompts + +Run below script to update custom prompts, which will get the latest prompts from github repository. + +```bash +./update-prompts.sh +``` + +#### Awesome Prompts +Custom Prompts are sourced from below location. +[awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts) \ No newline at end of file diff --git a/examples/server/public/index.html b/examples/server/public/index.html index 0c348f0ca..ef19c1ff4 100644 --- a/examples/server/public/index.html +++ b/examples/server/public/index.html @@ -250,13 +250,15 @@ } } - - .mode-chat textarea[name=prompt] { - height: 4.5em; + textarea { + width: 100%; + border-color: rgba(135, 135, 135, 0.4); + padding: 0.5em; + box-sizing: border-box; } - - .mode-completion textarea[name=prompt] { - height: 10em; + textarea[name=prompt] { + height: 20em; + margin: 1em 0; } [contenteditable] { @@ -316,12 +318,18 @@ image_selected: '' }) + // state of all prompts + const prompts = signal([]) + + // state for first messages of custom prompts. + const chatMessage = signal("") + const params = signal({ - n_predict: 400, - temperature: 0.7, + n_predict: -1, + temperature: 1.0, repeat_last_n: 256, // 0 = disable penalty, -1 = context size repeat_penalty: 1.18, // 1.0 = disabled - top_k: 40, // <= 0 to use vocab size + top_k: 0, // <= 0 to use vocab size top_p: 0.95, // 1.0 = disabled min_p: 0.05, // 0 = disabled tfs_z: 1.0, // 1.0 = disabled @@ -625,8 +633,9 @@ const submit = (e) => { stop(e); - chat(message.value); + chat(chatMessage.value || message.value); message.value = ""; + chatMessage.value = ""; } const enterSubmits = (event) => { @@ -639,8 +648,10 @@