radames commited on
Commit
b48dd87
1 Parent(s): 14f433b

Update phiWorker.js

Browse files
Files changed (1) hide show
  1. phiWorker.js +2 -2
phiWorker.js CHANGED
@@ -70,7 +70,7 @@ async function generate(data) {
70
  );
71
 
72
  self.postMessage({ status: "loading", message: "Initializing model" });
73
- model.init_with_prompt(
74
  prompt,
75
  temp,
76
  top_p,
@@ -80,7 +80,7 @@ async function generate(data) {
80
  );
81
  const seq_len = 2048;
82
 
83
- let sentence = "";
84
  let maxTokens = maxSeqLen ? maxSeqLen : seq_len - prompt.length - 1;
85
  let startTime = performance.now();
86
  let tokensCount = 0;
 
70
  );
71
 
72
  self.postMessage({ status: "loading", message: "Initializing model" });
73
+ const firstToken = model.init_with_prompt(
74
  prompt,
75
  temp,
76
  top_p,
 
80
  );
81
  const seq_len = 2048;
82
 
83
+ let sentence = firstToken;
84
  let maxTokens = maxSeqLen ? maxSeqLen : seq_len - prompt.length - 1;
85
  let startTime = performance.now();
86
  let tokensCount = 0;