refactored some issues

This commit is contained in:
FSSRepo 2023-10-09 08:00:59 -04:00
parent 59e7c0c51b
commit 8d3681ddbe

View file

@ -91,7 +91,7 @@ docReady(async () => {
document.getElementById("message").value = document.getElementById("message").value =
questions[Math.floor(Math.random() * questions.length)]; questions[Math.floor(Math.random() * questions.length)];
// to keep the same prompt format in all clients // to keep the same prompt format in all clients
const response = await fetch("http://localhost:8080/props"); const response = await fetch("/props");
if (!response.ok) { if (!response.ok) {
alert(`HTTP error! Status: ${response.status}`); alert(`HTTP error! Status: ${response.status}`);
} }
@ -132,7 +132,7 @@ async function call_llama(options) {
try { try {
controller = new AbortController(); controller = new AbortController();
signal = controller.signal; signal = controller.signal;
const response = await fetch("http://localhost:8080/completion", { const response = await fetch("/completion", {
method: "POST", method: "POST",
body: JSON.stringify(options), body: JSON.stringify(options),
headers: { headers: {
@ -207,7 +207,6 @@ function generatePrompt() {
prompt += assistant_name + conversation[index].assistant; prompt += assistant_name + conversation[index].assistant;
} }
} }
console.log(prompt)
return prompt; return prompt;
} }