Update script.js
Browse files
script.js
CHANGED
@@ -6,7 +6,7 @@ const userInput = document.getElementById('user-input');
|
|
6 |
const sendButton = document.getElementById('send-button');
|
7 |
|
8 |
(async () => {
|
9 |
-
const client = await Client.connect("
|
10 |
|
11 |
// Handle user input submission
|
12 |
sendButton.addEventListener('click', async () => {
|
@@ -17,11 +17,11 @@ const sendButton = document.getElementById('send-button');
|
|
17 |
userInput.value = '';
|
18 |
|
19 |
try {
|
20 |
-
const response = await client.predict(
|
21 |
-
|
22 |
});
|
23 |
|
24 |
-
const botMessage = response.data;
|
25 |
addMessageToChat('bot', botMessage);
|
26 |
} catch (error) {
|
27 |
console.error('Error:', error);
|
|
|
6 |
const sendButton = document.getElementById('send-button');
|
7 |
|
8 |
(async () => {
|
9 |
+
const client = await Client.connect("models/HuggingFaceH4/zephyr-7b-beta");
|
10 |
|
11 |
// Handle user input submission
|
12 |
sendButton.addEventListener('click', async () => {
|
|
|
17 |
userInput.value = '';
|
18 |
|
19 |
try {
|
20 |
+
const response = await client.predict({
|
21 |
+
"input_text": userMessage
|
22 |
});
|
23 |
|
24 |
+
const botMessage = response.data.results.output_text;
|
25 |
addMessageToChat('bot', botMessage);
|
26 |
} catch (error) {
|
27 |
console.error('Error:', error);
|