This commit is contained in:
cocktailpeanut 2023-03-22 12:57:23 -04:00
commit 7ceafb761c
1 changed files with 23 additions and 12 deletions

View File

@ -208,18 +208,28 @@
<ul id="messages"></ul>
<script src="/socket.io.min.js"></script>
<script>
const config = {
seed: -1,
threads: 4,
n_predict: 200,
top_k: 40,
top_p: 0.9,
temp: 0.8,
repeat_last_n: 64,
repeat_penalty: 1.3,
debug: false,
// html: true,
models: []
const str = localStorage.getItem("config")
let config
console.log("str", str)
if (str) {
try {
config = JSON.parse(str)
} catch (e) {
}
}
if (!config) {
config = {
seed: -1,
threads: 4,
n_predict: 200,
top_k: 40,
top_p: 0.9,
temp: 0.8,
repeat_last_n: 64,
repeat_penalty: 1.3,
debug: false,
models: []
}
}
const socket = io();
const form = document.getElementById('form');
@ -290,6 +300,7 @@ ${fields}
document.querySelector("#prompt-run").classList.add("hidden")
document.querySelector("#prompt-cancel").classList.remove("hidden")
buffer = "";
localStorage.setItem("config", JSON.stringify(config))
socket.emit('request', config)
config.id = null
loading(config.prompt)