leolaish commited on
Commit
e5ecddf
·
verified ·
1 Parent(s): b32aee5

Update script.js

Browse files
Files changed (1) hide show
  1. script.js +4 -4
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("leolaish/zephyr-7b-beta");
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("/predict", {
21
- param_0: userMessage,
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);