@trymirai/uzu 0.1.46 → 0.1.48

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/README.md CHANGED
@@ -26,7 +26,7 @@ Add the `uzu` dependency to your project's `package.json`:
26
26
 
27
27
  ```json
28
28
  "dependencies": {
29
- "@trymirai/uzu": "0.1.46"
29
+ "@trymirai/uzu": "0.1.48"
30
30
  }
31
31
  ```
32
32
 
@@ -4,8 +4,7 @@ export declare class SamplingMethod implements ToNapi<NapiSamplingMethod> {
4
4
  private readonly napiSamplingMethod;
5
5
  private constructor();
6
6
  static greedy(): SamplingMethod;
7
- static temperature(temperature: number): SamplingMethod;
8
- static topP(topP: number): SamplingMethod;
7
+ static stochastic(temperature: number | null, topK: number | null, topP: number | null): SamplingMethod;
9
8
  toNapi(): NapiSamplingMethod;
10
9
  }
11
10
  //# sourceMappingURL=samplingMethod.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"samplingMethod.d.mts","sourceRoot":"","sources":["../src/bridging/samplingMethod.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE;OACxC,EAAE,MAAM,EAAE;AAEjB,qBAAa,cAAe,YAAW,MAAM,CAAC,kBAAkB,CAAC;IAC7D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqB;IAExD,OAAO;IAIP,MAAM,CAAC,MAAM,IAAI,cAAc;IAK/B,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc;IAQvD,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAKzC,MAAM,IAAI,kBAAkB;CAG/B"}
1
+ {"version":3,"file":"samplingMethod.d.mts","sourceRoot":"","sources":["../src/bridging/samplingMethod.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE;OACxC,EAAE,MAAM,EAAE;AAEjB,qBAAa,cAAe,YAAW,MAAM,CAAC,kBAAkB,CAAC;IAC7D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqB;IAExD,OAAO;IAIP,MAAM,CAAC,MAAM,IAAI,cAAc;IAK/B,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc;IAgBvG,MAAM,IAAI,kBAAkB;CAG/B"}
@@ -4,8 +4,7 @@ export declare class SamplingMethod implements ToNapi<NapiSamplingMethod> {
4
4
  private readonly napiSamplingMethod;
5
5
  private constructor();
6
6
  static greedy(): SamplingMethod;
7
- static temperature(temperature: number): SamplingMethod;
8
- static topP(topP: number): SamplingMethod;
7
+ static stochastic(temperature: number | null, topK: number | null, topP: number | null): SamplingMethod;
9
8
  toNapi(): NapiSamplingMethod;
10
9
  }
11
10
  //# sourceMappingURL=samplingMethod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"samplingMethod.d.ts","sourceRoot":"","sources":["../src/bridging/samplingMethod.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE;OACxC,EAAE,MAAM,EAAE;AAEjB,qBAAa,cAAe,YAAW,MAAM,CAAC,kBAAkB,CAAC;IAC7D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqB;IAExD,OAAO;IAIP,MAAM,CAAC,MAAM,IAAI,cAAc;IAK/B,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc;IAQvD,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAKzC,MAAM,IAAI,kBAAkB;CAG/B"}
1
+ {"version":3,"file":"samplingMethod.d.ts","sourceRoot":"","sources":["../src/bridging/samplingMethod.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE;OACxC,EAAE,MAAM,EAAE;AAEjB,qBAAa,cAAe,YAAW,MAAM,CAAC,kBAAkB,CAAC;IAC7D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqB;IAExD,OAAO;IAIP,MAAM,CAAC,MAAM,IAAI,cAAc;IAK/B,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc;IAgBvG,MAAM,IAAI,kBAAkB;CAG/B"}
@@ -9,15 +9,19 @@ class SamplingMethod {
9
9
  const napiSamplingMethod = { type: 'Greedy' };
10
10
  return new SamplingMethod(napiSamplingMethod);
11
11
  }
12
- static temperature(temperature) {
13
- const napiSamplingMethod = {
14
- type: 'Temperature',
15
- temperature,
12
+ static stochastic(temperature, topK, topP) {
13
+ let napiSamplingMethod = {
14
+ type: 'Stochastic',
16
15
  };
17
- return new SamplingMethod(napiSamplingMethod);
18
- }
19
- static topP(topP) {
20
- const napiSamplingMethod = { type: 'TopP', topP };
16
+ if (temperature !== null) {
17
+ napiSamplingMethod.temperature = temperature;
18
+ }
19
+ if (topK !== null) {
20
+ napiSamplingMethod.topK = topK;
21
+ }
22
+ if (topP !== null) {
23
+ napiSamplingMethod.topP = topP;
24
+ }
21
25
  return new SamplingMethod(napiSamplingMethod);
22
26
  }
23
27
  toNapi() {
@@ -1 +1 @@
1
- {"version":3,"file":"samplingMethod.js","sourceRoot":"","sources":["../src/bridging/samplingMethod.ts"],"names":[],"mappings":";;;AAGA,MAAa,cAAc;IAGvB,YAAoB,kBAAsC;QACtD,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,MAAM;QACT,MAAM,kBAAkB,GAAuB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAClE,OAAO,IAAI,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,WAAmB;QAClC,MAAM,kBAAkB,GAAuB;YA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C;CACJ;AA/BD,wCA+BC"}
@@ -6,15 +6,19 @@ export class SamplingMethod {
6
6
  const napiSamplingMethod = { type: 'Greedy' };
7
7
  return new SamplingMethod(napiSamplingMethod);
8
8
  }
9
- static temperature(temperature) {
10
- const napiSamplingMethod = {
11
- type: 'Temperature',
12
- temperature,
9
+ static stochastic(temperature, topK, topP) {
10
+ let napiSamplingMethod = {
11
+ type: 'Stochastic',
13
12
  };
14
- return new SamplingMethod(napiSamplingMethod);
15
- }
16
- static topP(topP) {
17
- const napiSamplingMethod = { type: 'TopP', topP };
13
+ if (temperature !== null) {
14
+ napiSamplingMethod.temperature = temperature;
15
+ }
16
+ if (topK !== null) {
17
+ napiSamplingMethod.topK = topK;
18
+ }
19
+ if (topP !== null) {
20
+ napiSamplingMethod.topP = topP;
21
+ }
18
22
  return new SamplingMethod(napiSamplingMethod);
19
23
  }
20
24
  toNapi() {
@@ -1 +1 @@
1
- {"version":3,"file":"samplingMethod.mjs","sourceRoot":"","sources":["../src/bridging/samplingMethod.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IAGvB,YAAoB,kBAAsC;QACtD,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,MAAM;QACT,MAAM,kBAAkB,GAAuB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAClE,OAAO,IAAI,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,WAAmB;QAClC,MAAM,kBAAkB,GAAuB;YAC3C,IAAI,EAAE,aAAa;YACnB,WAAW;SACd,CAAC;QACF,OAAO,IAAI,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,IAAY;QACpB,MAAM,kBAAkB,GAAuB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACtE,OAAO,IAAI,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAClD,CAAC;IAED,MAAM;QACF,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;CACJ"}
1
+ {"version":3,"file":"samplingMethod.mjs","sourceRoot":"","sources":["../src/bridging/samplingMethod.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IAGvB,YAAoB,kBAAsC;QACtD,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,MAAM;QACT,MAAM,kBAAkB,GAAuB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAClE,OAAO,IAAI,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,WAA0B,EAAE,IAAmB,EAAE,IAAmB;QAClF,IAAI,kBAAkB,GAAuB;YACzC,IAAI,EAAE,YAAY;SACrB,CAAC;QACF,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;YACvB,kBAAkB,CAAC,WAAW,GAAG,WAAW,CAAC;QACjD,CAAC;QACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAChB,kBAAkB,CAAC,IAAI,GAAG,IAAI,CAAC;QACnC,CAAC;QACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAChB,kBAAkB,CAAC,IAAI,GAAG,IAAI,CAAC;QACnC,CAAC;QACD,OAAO,IAAI,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAClD,CAAC;IAED,MAAM;QACF,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;CACJ"}
package/napi/uzu.d.ts CHANGED
@@ -174,8 +174,7 @@ export interface RunStats {
174
174
 
175
175
  export type SamplingMethod =
176
176
  | { type: 'Greedy' }
177
- | { type: 'Temperature', temperature: number }
178
- | { type: 'TopP', topP: number }
177
+ | { type: 'Stochastic', temperature?: number, topK?: number, topP?: number }
179
178
 
180
179
  export type SamplingPolicy =
181
180
  | { type: 'Default' }
package/napi/uzu.node CHANGED
Binary file
package/package.json CHANGED
@@ -98,5 +98,5 @@
98
98
  },
99
99
  "type": "commonjs",
100
100
  "types": "./index.d.ts",
101
- "version": "0.1.46"
101
+ "version": "0.1.48"
102
102
  }
@@ -13,16 +13,19 @@ export class SamplingMethod implements ToNapi<NapiSamplingMethod> {
13
13
  return new SamplingMethod(napiSamplingMethod);
14
14
  }
15
15
 
16
- static temperature(temperature: number): SamplingMethod {
17
- const napiSamplingMethod: NapiSamplingMethod = {
18
- type: 'Temperature',
19
- temperature,
16
+ static stochastic(temperature: number | null, topK: number | null, topP: number | null): SamplingMethod {
17
+ let napiSamplingMethod: NapiSamplingMethod = {
18
+ type: 'Stochastic',
20
19
  };
21
- return new SamplingMethod(napiSamplingMethod);
22
- }
23
-
24
- static topP(topP: number): SamplingMethod {
25
- const napiSamplingMethod: NapiSamplingMethod = { type: 'TopP', topP };
20
+ if (temperature !== null) {
21
+ napiSamplingMethod.temperature = temperature;
22
+ }
23
+ if (topK !== null) {
24
+ napiSamplingMethod.topK = topK;
25
+ }
26
+ if (topP !== null) {
27
+ napiSamplingMethod.topP = topP;
28
+ }
26
29
  return new SamplingMethod(napiSamplingMethod);
27
30
  }
28
31
 
package/src/napi/uzu.d.ts CHANGED
@@ -174,8 +174,7 @@ export interface RunStats {
174
174
 
175
175
  export type SamplingMethod =
176
176
  | { type: 'Greedy' }
177
- | { type: 'Temperature', temperature: number }
178
- | { type: 'TopP', topP: number }
177
+ | { type: 'Stochastic', temperature?: number, topK?: number, topP?: number }
179
178
 
180
179
  export type SamplingPolicy =
181
180
  | { type: 'Default' }
package/src/napi/uzu.node CHANGED
Binary file
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.46';
1
+ export const VERSION = '0.1.48';
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.46";
1
+ export declare const VERSION = "0.1.48";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.46";
1
+ export declare const VERSION = "0.1.48";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.1.46';
4
+ exports.VERSION = '0.1.48';
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.46';
1
+ export const VERSION = '0.1.48';
2
2
  //# sourceMappingURL=version.mjs.map