@desert-ant-labs/emo 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -1
- package/dist/index.browser.js +14 -1
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
# @desert-ant-labs/emo
|
|
2
2
|
|
|
3
|
+
**On-device emoji suggestion for Node and the browser. TypeScript-native, offline, multilingual, no inference runtime.**
|
|
4
|
+
|
|
3
5
|
On-device emoji suggestions from text. Suggests the best-matching emoji for short
|
|
4
6
|
tasks, calendar entries, notes, or message drafts across **23 languages**, fully
|
|
5
|
-
in-process, no inference runtime.
|
|
7
|
+
in-process, no inference runtime. Emo does emoji prediction (text-to-emoji), useful
|
|
8
|
+
for a keyboard, an autocomplete, or any text field. It runs in TypeScript and
|
|
9
|
+
JavaScript, in Node and in the browser. Emo suggests emoji from text; it is not an
|
|
10
|
+
emoji picker.
|
|
6
11
|
|
|
7
12
|
```ts
|
|
8
13
|
import { suggestions } from "@desert-ant-labs/emo";
|
|
@@ -112,6 +117,14 @@ emoji for each task on-device. Run it with `node server.js` from that folder and
|
|
|
112
117
|
|
|
113
118
|
Published at [`desert-ant-labs/emo`](https://huggingface.co/desert-ant-labs/emo) on Hugging Face.
|
|
114
119
|
|
|
120
|
+
## Other platforms
|
|
121
|
+
|
|
122
|
+
Same model, native on each platform:
|
|
123
|
+
|
|
124
|
+
- [`emo-swift`](https://github.com/Desert-Ant-Labs/emo-swift): Swift for iOS and macOS
|
|
125
|
+
- [`emo-kotlin`](https://github.com/Desert-Ant-Labs/emo-kotlin): Kotlin for Android and the JVM
|
|
126
|
+
- Model weights and card: [`desert-ant-labs/emo`](https://huggingface.co/desert-ant-labs/emo)
|
|
127
|
+
|
|
115
128
|
## License
|
|
116
129
|
|
|
117
130
|
[Desert Ant Labs Source-Available License](https://license.desertant.ai/1.0). Free for
|
package/dist/index.browser.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { initUsage } from "@desert-ant-labs/desert-ant-web";
|
|
1
2
|
import { webCache } from "./cache-web.js";
|
|
2
3
|
import { DEFAULT_HOST, DEFAULT_REPO, DEFAULT_REVISION, loadModel } from "./hub.js";
|
|
3
4
|
export { createEmo, EmoModel } from "./model.js";
|
|
@@ -11,10 +12,22 @@ export const env = {
|
|
|
11
12
|
allowRemote: true,
|
|
12
13
|
useCache: true,
|
|
13
14
|
};
|
|
15
|
+
const USAGE_KEY = "dal_lEL3EuFU2eh8IRTH8RW9pV9czYn0TrCk";
|
|
16
|
+
let usage = null;
|
|
17
|
+
function instrument(model) {
|
|
18
|
+
const suggestions = model.suggestions.bind(model);
|
|
19
|
+
model.suggestions = (text, limit, options) => {
|
|
20
|
+
usage ??= initUsage({ key: USAGE_KEY });
|
|
21
|
+
const out = suggestions(text, limit, options);
|
|
22
|
+
usage.recordCall();
|
|
23
|
+
return out;
|
|
24
|
+
};
|
|
25
|
+
return model;
|
|
26
|
+
}
|
|
14
27
|
/** Loads the model from the Hugging Face Hub (cached in Cache Storage). */
|
|
15
28
|
export async function load(options = {}) {
|
|
16
29
|
const e = { ...env, ...options };
|
|
17
|
-
return loadModel(e, e.useCache ? webCache() : null);
|
|
30
|
+
return instrument(await loadModel(e, e.useCache ? webCache() : null));
|
|
18
31
|
}
|
|
19
32
|
let modelPromise = null;
|
|
20
33
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@desert-ant-labs/emo",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "On-device emoji suggestions from text.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.node.js",
|
|
@@ -51,9 +51,15 @@
|
|
|
51
51
|
},
|
|
52
52
|
"keywords": [
|
|
53
53
|
"emoji",
|
|
54
|
+
"emoji-suggestion",
|
|
55
|
+
"emoji-prediction",
|
|
56
|
+
"text-to-emoji",
|
|
57
|
+
"emoji-autocomplete",
|
|
54
58
|
"on-device",
|
|
59
|
+
"offline",
|
|
55
60
|
"multilingual",
|
|
56
|
-
"
|
|
61
|
+
"typescript",
|
|
62
|
+
"keyboard"
|
|
57
63
|
],
|
|
58
64
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
59
65
|
"repository": {
|
|
@@ -68,6 +74,9 @@
|
|
|
68
74
|
"publishConfig": {
|
|
69
75
|
"access": "public"
|
|
70
76
|
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@desert-ant-labs/desert-ant-web": "^0.1.0"
|
|
79
|
+
},
|
|
71
80
|
"devDependencies": {
|
|
72
81
|
"@arethetypeswrong/cli": "^0.18",
|
|
73
82
|
"@types/node": "^22",
|