@genai-fi/nanogpt 1.6.0 → 1.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.
|
@@ -184,11 +184,11 @@ var D = class extends e {
|
|
|
184
184
|
async _generate(e, t) {
|
|
185
185
|
let n = !1;
|
|
186
186
|
if (e?.rescore && this.outputConversation.length > 0) {
|
|
187
|
-
let e = this.outputConversation.
|
|
187
|
+
let e = this.outputConversation[this.outputConversation.length - 1];
|
|
188
188
|
if (!e || !e._output) throw Error("No raw output found for the last conversation entry");
|
|
189
|
-
this.rawOutput = e?._output;
|
|
189
|
+
this.rawOutput = e?._output, e.content = "";
|
|
190
190
|
}
|
|
191
|
-
this.outputConversation.length === 0 || this.outputConversation[this.outputConversation.length - 1]._completed || this.outputConversation[this.outputConversation.length - 1].role !== "assistant" && e?.nonConversational !== !0 || this.outputConversation[this.outputConversation.length - 1].role !== "text" && e?.nonConversational === !0 ? (this.outputConversation.push({
|
|
191
|
+
this.outputConversation.length === 0 || this.outputConversation[this.outputConversation.length - 1]._completed || this.outputConversation[this.outputConversation.length - 1].role !== "assistant" && e?.nonConversational !== !0 || this.outputConversation[this.outputConversation.length - 1].role !== "text" && e?.nonConversational === !0 ? (e?.rescore || this.outputConversation.push({
|
|
192
192
|
role: e?.nonConversational === !0 ? "text" : "assistant",
|
|
193
193
|
content: "",
|
|
194
194
|
_timestamp: Date.now()
|
|
@@ -229,7 +229,7 @@ var D = class extends e {
|
|
|
229
229
|
r._completed = !0;
|
|
230
230
|
break;
|
|
231
231
|
}
|
|
232
|
-
t === a - 1 && a > 1 && (r._completed = !0, n.terminated = !0), r.content += n.text, r._output ||= [], r._output.push(n);
|
|
232
|
+
t === a - 1 && a > 1 && (r._completed = !0, n.terminated = !0), r.content += n.text, r._output ||= [], e?.rescore || r._output.push(n);
|
|
233
233
|
}
|
|
234
234
|
return i.dispose(), this.outputConversation;
|
|
235
235
|
}
|
package/dist/api/responses.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as default, n as isConversation } from "../Generator-
|
|
1
|
+
export { t as default, n as isConversation } from "../Generator-8IK28IWR.js";
|