import { pipeline, env } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.10.1'; // Since we will download the model from the Hugging Face Hub, we can skip the local model check env.allowLocalModels = false; // Reference the elements that we will need const status = document.getElementById('status'); const msg = document.getElementById('message'); // Create a new object detection pipeline status.textContent = 'Loading model...'; const classifier = await pipeline('text-classification', 'bajrangCoder/roberta_spam_onnx_quantised'); //const classifier = await pipeline('text-classification', 'bajrangCoder/roberta_spam_onnx'); status.textContent = 'Ready'; async function checkMessage(){ status.textContent = 'Analysing...'; const output = await classifier(msg.value); status.textContent = JSON.stringify(output); }