@genai-fi/nanogpt 1.0.2 → 1.0.3
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/dist/api/responses.js +3 -3
- package/dist/api/training.js +6 -2
- package/dist/data/pdf.js +11 -11
- package/dist/data/textLoader.js +4 -4
- package/dist/loader/loadZipMeta.js +1 -1
- package/dist/models/config.js +1 -1
- package/dist/{pdf-CdmW8ikl.js → pdf-Bzuk68Vy.js} +11047 -8714
- package/package.json +3 -3
package/dist/api/responses.js
CHANGED
|
@@ -103,7 +103,7 @@ var r = class {
|
|
|
103
103
|
callback: t
|
|
104
104
|
};
|
|
105
105
|
if (this._responses.set(r, a), this._busyCount > 0 && !e.background) {
|
|
106
|
-
if (this._jobQueue.length > 10) throw Error("
|
|
106
|
+
if (this._jobQueue.length > 10) throw Error("queue_too_long");
|
|
107
107
|
return new Promise((n, i) => {
|
|
108
108
|
this._jobQueue.push({
|
|
109
109
|
id: r,
|
|
@@ -121,7 +121,7 @@ var r = class {
|
|
|
121
121
|
if (n) {
|
|
122
122
|
let r = n.generator.getConversation();
|
|
123
123
|
if (t !== void 0 && t >= 0 && t < r.length && r.splice(t), n.done = !1, n.timestamp = Date.now(), this._busyCount > 0 && !n.options.background) {
|
|
124
|
-
if (this._jobQueue.length > 10) throw Error("
|
|
124
|
+
if (this._jobQueue.length > 10) throw Error("queue_too_long");
|
|
125
125
|
return new Promise((t, r) => {
|
|
126
126
|
this._jobQueue.push({
|
|
127
127
|
id: e,
|
|
@@ -134,7 +134,7 @@ var r = class {
|
|
|
134
134
|
}
|
|
135
135
|
return this._runForRecord(e, n.options, n.callback);
|
|
136
136
|
}
|
|
137
|
-
throw Error(
|
|
137
|
+
throw Error("response_not_found");
|
|
138
138
|
}
|
|
139
139
|
getResponse(e) {
|
|
140
140
|
let t = this._responses.get(e);
|
package/dist/api/training.js
CHANGED
|
@@ -139,7 +139,11 @@ var o = class {
|
|
|
139
139
|
};
|
|
140
140
|
if (!u) throw Error("invalid_previous_job_id");
|
|
141
141
|
if (this._jobs.set(u.id, u), this.setState(u, "pending"), o instanceof t) {
|
|
142
|
-
if (u.datasetId && o.datasetId !== u.datasetId
|
|
142
|
+
if (u.datasetId && o.datasetId !== u.datasetId) {
|
|
143
|
+
let e = /* @__PURE__ */ Error("dataset_mismatch");
|
|
144
|
+
throw this.setState(u, "error", e), e;
|
|
145
|
+
}
|
|
146
|
+
if (o.tokeniserId !== this._tokeniser.id) {
|
|
143
147
|
let e = /* @__PURE__ */ Error("tokeniser_mismatch");
|
|
144
148
|
throw this.setState(u, "error", e), e;
|
|
145
149
|
}
|
|
@@ -191,7 +195,7 @@ var o = class {
|
|
|
191
195
|
}
|
|
192
196
|
dispose() {
|
|
193
197
|
for (let e of this._jobs.values()) {
|
|
194
|
-
if (e.state === "running") throw Error(
|
|
198
|
+
if (e.state === "running") throw Error("job_still_running");
|
|
195
199
|
e.trainer.dispose();
|
|
196
200
|
}
|
|
197
201
|
this._jobs.clear(), this.ee.removeAllListeners();
|