File tree Expand file tree Collapse file tree 3 files changed +29
-16
lines changed
get-started-latency-breakdown
tests/scripts/sanity_checks Expand file tree Collapse file tree 3 files changed +29
-16
lines changed Original file line number Diff line number Diff line change 11# WebLLM Get Started App
22
3- This folder provides a minimum demo to show WebLLM API in a webapp setting with
3+ This folder provides a minimum demo to show WebLLM API in a webapp setting with
44collection of latency statistics for individual token sampling steps.
55To try it out, you can do the following steps under this folder
66
Original file line number Diff line number Diff line change 1- <!DOCTYPE html>
1+ <!doctype html>
22< html lang ="en ">
3- < head >
3+ < head >
44 < meta charset ="UTF-8 " />
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
66 < title > GPU sampleTokenFromLogits Tests</ title >
77 < style >
8- body { font-family : Arial, sans-serif; margin : 2em ; }
9- .label { margin : 0.5em 0 ; font-weight : bold; }
10- .result { margin : 0.5em 0 1.5em 0 ; padding : 0.5em ; background : # f4f4f4 ; border-radius : 4px ; }
11- button { padding : 0.5em 1em ; font-size : 1em ; }
8+ body {
9+ font-family : Arial, sans-serif;
10+ margin : 2em ;
11+ }
12+ .label {
13+ margin : 0.5em 0 ;
14+ font-weight : bold;
15+ }
16+ .result {
17+ margin : 0.5em 0 1.5em 0 ;
18+ padding : 0.5em ;
19+ background : # f4f4f4 ;
20+ border-radius : 4px ;
21+ }
22+ button {
23+ padding : 0.5em 1em ;
24+ font-size : 1em ;
25+ }
1226 </ style >
13- </ head >
14- < body >
27+ </ head >
28+ < body >
1529 < h1 > GPU sampleTokenFromLogits Tests</ h1 >
1630 < button id ="run-tests "> Re-run All Tests</ button >
1731 < div class ="label "> Overall:</ div >
@@ -25,11 +39,11 @@ <h1>GPU sampleTokenFromLogits Tests</h1>
2539 < div class ="label "> Logprobs:</ div >
2640 < div id ="logprobs-label " class ="result "> </ div >
2741 < script type ="module ">
28- import ' ./sanity_checks.ts' ;
29- document . getElementById ( ' run-tests' ) . onclick = ( ) => {
30- // Reload the module to rerun tests
31- window . location . reload ( ) ;
32- } ;
42+ import " ./sanity_checks.ts" ;
43+ document . getElementById ( " run-tests" ) . onclick = ( ) => {
44+ // Reload the module to rerun tests
45+ window . location . reload ( ) ;
46+ } ;
3347 </ script >
34- </ body >
48+ </ body >
3549</ html >
Original file line number Diff line number Diff line change @@ -1276,7 +1276,6 @@ export class LLMChatPipeline {
12761276 temperature = Math . max ( 1e-6 , temperature ) ; // to prevent division by zero
12771277
12781278 const numSeqs = 1 ;
1279- const numTokens = this . appearedTokensFreq . size ;
12801279
12811280 const temperatures = new Float32Array ( [ temperature ] ) ;
12821281
You can’t perform that action at this time.
0 commit comments