@getmikk/intent-engine 2.0.17 → 2.0.18
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/package.json +1 -1
- package/src/semantic-searcher.ts +7 -1
package/package.json
CHANGED
package/src/semantic-searcher.ts
CHANGED
|
@@ -152,10 +152,16 @@ export class SemanticSearcher {
|
|
|
152
152
|
}).filter((r): r is SemanticMatch => r !== null)
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
private async ensurePipeline() {
|
|
155
|
+
private async ensurePipeline(progressMsg?: string) {
|
|
156
156
|
if (this.pipeline) return
|
|
157
|
+
if (progressMsg && this.onProgress) {
|
|
158
|
+
this.onProgress(0)
|
|
159
|
+
}
|
|
157
160
|
const { pipeline } = await import('@xenova/transformers')
|
|
158
161
|
this.pipeline = await pipeline('feature-extraction', SemanticSearcher.MODEL)
|
|
162
|
+
if (this.onProgress) {
|
|
163
|
+
this.onProgress(5)
|
|
164
|
+
}
|
|
159
165
|
}
|
|
160
166
|
}
|
|
161
167
|
|