Update index.js
Browse files
index.js
CHANGED
@@ -6,14 +6,14 @@ env.allowLocalModels = false;
|
|
6 |
// Reference the elements that we will need
|
7 |
const status = document.getElementById('status');
|
8 |
const msg = document.getElementById('message');
|
9 |
-
|
10 |
// Create a new object detection pipeline
|
11 |
status.textContent = 'Loading model...';
|
12 |
const classifier = await pipeline('text-classification', 'bajrangCoder/roberta_spam_onnx_quantised');
|
13 |
//const classifier = await pipeline('text-classification', 'bajrangCoder/roberta_spam_onnx');
|
14 |
status.textContent = 'Ready';
|
15 |
|
16 |
-
async function
|
17 |
status.textContent = 'Analysing...';
|
18 |
const output = await classifier(msg.value);
|
19 |
status.textContent = JSON.stringify(output);
|
|
|
6 |
// Reference the elements that we will need
|
7 |
const status = document.getElementById('status');
|
8 |
const msg = document.getElementById('message');
|
9 |
+
const checkMessage = document.getElementById('checkMessage');
|
10 |
// Create a new object detection pipeline
|
11 |
status.textContent = 'Loading model...';
|
12 |
const classifier = await pipeline('text-classification', 'bajrangCoder/roberta_spam_onnx_quantised');
|
13 |
//const classifier = await pipeline('text-classification', 'bajrangCoder/roberta_spam_onnx');
|
14 |
status.textContent = 'Ready';
|
15 |
|
16 |
+
checkMessage.onclick = async function (){
|
17 |
status.textContent = 'Analysing...';
|
18 |
const output = await classifier(msg.value);
|
19 |
status.textContent = JSON.stringify(output);
|