@sedum-dev/provider-clef 0.1.0-alpha.21 → 0.1.0-alpha.22
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/index.d.ts +1 -0
- package/dist/index.js +8 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ declare class ClefAdapter implements Resolver, Judge, ClassificationProvider, Go
|
|
|
46
46
|
probabilities: number[];
|
|
47
47
|
calls: _sedum_dev_core.ProviderCall[];
|
|
48
48
|
chunkCount: number;
|
|
49
|
+
oversized: number[];
|
|
49
50
|
}>;
|
|
50
51
|
classifyBatch(sentences: readonly string[], options?: ProviderCallOptions): Promise<{
|
|
51
52
|
answers: ModelClassification[];
|
package/dist/index.js
CHANGED
|
@@ -240,7 +240,7 @@ function buildRelevanceRequests(diff, tests, model) {
|
|
|
240
240
|
diff,
|
|
241
241
|
tests,
|
|
242
242
|
(text, questions) => ({ model, state: { diff: text }, questions }),
|
|
243
|
-
{ pair: 28e3, batch: 56e3, questions: 64 }
|
|
243
|
+
{ pair: 28e3, batch: 56e3, questions: 64, minDiff: 4096 }
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
246
|
|
|
@@ -799,7 +799,11 @@ var ClefAdapter = class {
|
|
|
799
799
|
}
|
|
800
800
|
}
|
|
801
801
|
async scoreRelevance(diff, tests, options) {
|
|
802
|
-
const chunks = buildRelevanceRequests(
|
|
802
|
+
const { batches: chunks, oversized } = buildRelevanceRequests(
|
|
803
|
+
diff,
|
|
804
|
+
tests,
|
|
805
|
+
this.model
|
|
806
|
+
);
|
|
803
807
|
const probabilities = tests.map(() => 0);
|
|
804
808
|
const calls = [];
|
|
805
809
|
for (const chunk of chunks) {
|
|
@@ -825,7 +829,8 @@ var ClefAdapter = class {
|
|
|
825
829
|
return {
|
|
826
830
|
probabilities,
|
|
827
831
|
calls,
|
|
828
|
-
chunkCount: new Set(chunks.map((chunk) => chunk.chunkIndex)).size
|
|
832
|
+
chunkCount: new Set(chunks.map((chunk) => chunk.chunkIndex)).size,
|
|
833
|
+
oversized
|
|
829
834
|
};
|
|
830
835
|
}
|
|
831
836
|
async classifyBatch(sentences, options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sedum-dev/provider-clef",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.22",
|
|
4
4
|
"repository": "https://github.com/sedum-dev/sedum",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@sedum-dev/core": "0.1.0-alpha.
|
|
22
|
+
"@sedum-dev/core": "0.1.0-alpha.22"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "tsup src/index.ts --format esm --dts --clean --out-dir dist",
|