latishab commited on
Commit
21f69e9
·
verified ·
1 Parent(s): 1f4db4c

Add widget

Browse files
Files changed (1) hide show
  1. widget.js +19 -0
widget.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ```javascript
3
+ async function query(data) {
4
+ const response = await fetch(
5
+ "https://api-inference.huggingface.co/models/latishab/turnsense",
6
+ {
7
+ headers: { Authorization: "Bearer $HUGGINGFACE_TOKEN" },
8
+ method: "POST",
9
+ body: JSON.stringify(data),
10
+ }
11
+ );
12
+ const result = await response.json();
13
+ return result;
14
+ }
15
+
16
+ // Example usage
17
+ query({"inputs": "Your text here"}).then((response) => {
18
+ console.log(JSON.stringify(response));
19
+ });