neetnestor
commited on
Commit
•
668e490
1
Parent(s):
871174e
Add more stats metrics
Browse files- dist/index.js +0 -0
- package.json +1 -1
- src/index.js +14 -4
- yarn.lock +4 -4
dist/index.js
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
package.json
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
"build": "webpack --config webpack.config.js"
|
7 |
},
|
8 |
"dependencies": {
|
9 |
-
"@charliefruan/web-llm": "^0.2.
|
10 |
"@sinclair/typebox": "^0.33.16",
|
11 |
"ace-builds": "^1.36.2",
|
12 |
"highlight.js": "^11.10.0"
|
|
|
6 |
"build": "webpack --config webpack.config.js"
|
7 |
},
|
8 |
"dependencies": {
|
9 |
+
"@charliefruan/web-llm": "^0.2.75",
|
10 |
"@sinclair/typebox": "^0.33.16",
|
11 |
"ace-builds": "^1.36.2",
|
12 |
"highlight.js": "^11.10.0"
|
src/index.js
CHANGED
@@ -185,13 +185,23 @@ Patronus is a string.
|
|
185 |
1
|
186 |
)} tok/s`);
|
187 |
}
|
188 |
-
if (usage.extra.
|
189 |
-
statsTextParts.push(`
|
190 |
0
|
191 |
)} ms`);
|
192 |
}
|
193 |
-
if (usage.extra.
|
194 |
-
statsTextParts.push(`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
2
|
196 |
)} ms`);
|
197 |
}
|
|
|
185 |
1
|
186 |
)} tok/s`);
|
187 |
}
|
188 |
+
if (usage.extra.time_per_output_token_s) {
|
189 |
+
statsTextParts.push(`Time to First Token: ${(1000 * usage.extra.time_per_output_token_s).toFixed(
|
190 |
0
|
191 |
)} ms`);
|
192 |
}
|
193 |
+
if (usage.extra.time_to_first_token_s) {
|
194 |
+
statsTextParts.push(`Time Per Output Token: ${(1000 * usage.extra.time_to_first_token_s).toFixed(
|
195 |
+
0
|
196 |
+
)} ms`);
|
197 |
+
}
|
198 |
+
if (usage.extra.grammar_init_s) {
|
199 |
+
statsTextParts.push(`Grammar Init Overhead: ${(1000 * usage.extra.grammar_init_s).toFixed(
|
200 |
+
0
|
201 |
+
)} ms`);
|
202 |
+
}
|
203 |
+
if (usage.extra.grammar_per_token_s) {
|
204 |
+
statsTextParts.push(`Grammar Per-token Overhead: ${(1000 * usage.extra.grammar_per_token_s).toFixed(
|
205 |
2
|
206 |
)} ms`);
|
207 |
}
|
yarn.lock
CHANGED
@@ -802,10 +802,10 @@
|
|
802 |
"@babel/helper-validator-identifier" "^7.25.7"
|
803 |
to-fast-properties "^2.0.0"
|
804 |
|
805 |
-
"@charliefruan/web-llm@^0.2.
|
806 |
-
version "0.2.
|
807 |
-
resolved "https://registry.yarnpkg.com/@charliefruan/web-llm/-/web-llm-0.2.
|
808 |
-
integrity sha512-
|
809 |
dependencies:
|
810 |
loglevel "^1.9.1"
|
811 |
|
|
|
802 |
"@babel/helper-validator-identifier" "^7.25.7"
|
803 |
to-fast-properties "^2.0.0"
|
804 |
|
805 |
+
"@charliefruan/web-llm@^0.2.75":
|
806 |
+
version "0.2.75"
|
807 |
+
resolved "https://registry.yarnpkg.com/@charliefruan/web-llm/-/web-llm-0.2.75.tgz#82dd22b8c540c796c779b4d1ec136e096fab8e46"
|
808 |
+
integrity sha512-L7UB5nnhJ/hQax20DgH5njw0MR3MQCI/UHppdGpN1WcPDvTr01pwhEEm0NDMopKdYgFASwcHOYC4TwMzc1ngDg==
|
809 |
dependencies:
|
810 |
loglevel "^1.9.1"
|
811 |
|