Spaces:
Running
Running
Create deberta.js
Browse files- deberta.js +17 -0
deberta.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
// Import the library
|
| 3 |
+
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/[email protected]';
|
| 4 |
+
// Make it available globally
|
| 5 |
+
window.pipeline = pipeline;
|
| 6 |
+
*/
|
| 7 |
+
async function makepipe() {
|
| 8 |
+
return await pipeline('sentiment-analysis');
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
async function main() {
|
| 12 |
+
let pipe = await makepipe();
|
| 13 |
+
let out = await pipe('I love transformers!');
|
| 14 |
+
console.log(out);
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
//main();
|