Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
import { pipeline, env } from
|
2 |
|
3 |
// Since we will download the model from the Hugging Face Hub, we can skip the local model check
|
4 |
env.allowLocalModels = false;
|
5 |
|
6 |
-
const answerer = await pipeline('question-answering', '
|
7 |
var chatBox = document.getElementById("chat-box");
|
8 |
const sendMessageButton = document.getElementById('send-btn');
|
9 |
|
@@ -21,8 +21,7 @@ function sendMessage() {
|
|
21 |
|
22 |
// Detect objects in the image
|
23 |
async function getAnswer(question) {
|
24 |
-
const
|
25 |
-
const output = await answerer(question, context);
|
26 |
setTimeout(function() {
|
27 |
chatBox.innerHTML += "<p class='bot-message'><strong>Chatbot:</strong> " + output.answer + "</p>";
|
28 |
// Scroll to bottom of chat box
|
|
|
1 |
+
import { pipeline, env } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers";
|
2 |
|
3 |
// Since we will download the model from the Hugging Face Hub, we can skip the local model check
|
4 |
env.allowLocalModels = false;
|
5 |
|
6 |
+
const answerer = await pipeline('question-answering', 'danishmuhammad/ccat_2025_llama3.1_8B');
|
7 |
var chatBox = document.getElementById("chat-box");
|
8 |
const sendMessageButton = document.getElementById('send-btn');
|
9 |
|
|
|
21 |
|
22 |
// Detect objects in the image
|
23 |
async function getAnswer(question) {
|
24 |
+
const output = await answerer(question);
|
|
|
25 |
setTimeout(function() {
|
26 |
chatBox.innerHTML += "<p class='bot-message'><strong>Chatbot:</strong> " + output.answer + "</p>";
|
27 |
// Scroll to bottom of chat box
|