@rumbl/laserbeak
Advanced tools
Comparing version 0.7.2 to 0.7.3
export { InferenceSession } from './inferenceSession'; | ||
export { AvailableModels } from "./models"; | ||
export { SessionManager } from "./sessionManager"; | ||
export { GenerationConfig } from "./session.worker"; |
@@ -1,2 +0,2 @@ | ||
import { Session } from "./session.worker"; | ||
import { GenerationConfig, Session } from "./session.worker"; | ||
import * as Comlink from "comlink"; | ||
@@ -8,3 +8,4 @@ import { AvailableModels } from "./models"; | ||
initSession(model: AvailableModels): Promise<void>; | ||
run(input: string, callback: (decoded: string) => void): Promise<void>; | ||
run(input: string, callback: (decoded: string) => void, generation_config?: GenerationConfig): Promise<void>; | ||
destroy(): void; | ||
} |
@@ -23,13 +23,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
run(input, callback) { | ||
run(input, callback, generation_config) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (this.session instanceof Session) { | ||
return yield this.session.run(input, callback); | ||
return yield this.session.run(input, callback, generation_config); | ||
} | ||
else { | ||
return yield this.session.run(input, Comlink.proxy(callback)); | ||
return yield this.session.run(input, Comlink.proxy(callback), generation_config); | ||
} | ||
}); | ||
} | ||
destroy() { | ||
this.session = null; | ||
} | ||
} | ||
//# sourceMappingURL=inferenceSession.js.map |
import * as rumble from "@rumbl/rumble-wasm"; | ||
import { AvailableModels } from "./models"; | ||
export interface GenerationConfig { | ||
max_length: number; | ||
temperature: number; | ||
top_k: number; | ||
top_p: number; | ||
repetition_penalty: number; | ||
} | ||
export declare class Session { | ||
@@ -8,3 +15,3 @@ rumbleSession: rumble.Session | undefined; | ||
initSession(model: AvailableModels): Promise<void>; | ||
run(input: string, callback: (decoded: string) => void): Promise<void>; | ||
run(input: string, callback: (decoded: string) => void, generation_config?: GenerationConfig): Promise<void>; | ||
} |
@@ -61,3 +61,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
run(input, callback) { | ||
run(input, callback, generation_config) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -67,9 +67,9 @@ if (!this.rumbleSession) { | ||
} | ||
return yield this.rumbleSession.stream(input, callback); | ||
return yield this.rumbleSession.stream(input, callback, generation_config); | ||
}); | ||
} | ||
} | ||
if (typeof self !== 'undefined') { | ||
if (typeof self !== "undefined") { | ||
Comlink.expose(Session); | ||
} | ||
//# sourceMappingURL=session.worker.js.map |
{ | ||
"name": "@rumbl/laserbeak", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"author": "Christopher Fleetwood <chris@fleetwood.dev>", | ||
@@ -21,3 +21,3 @@ "description": "ML on the GPU comes to the browser", | ||
"dependencies": { | ||
"@rumbl/rumble-wasm": "0.7.1", | ||
"@rumbl/rumble-wasm": "0.7.2", | ||
"comlink": "4.3.1", | ||
@@ -24,0 +24,0 @@ "idb": "^7.1.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40198
579
+ Added@rumbl/rumble-wasm@0.7.2(transitive)
- Removed@rumbl/rumble-wasm@0.7.1(transitive)
Updated@rumbl/rumble-wasm@0.7.2