Skip to content

fix(laya): LayaModelLoader.load(Path, …) is a member again - #503

Merged
michalharakal merged 1 commit into
SKaiNET-developers:developfrom
michalharakal:fix/laya-loader-jvm-member
Oct 17, 2026
Merged

michalharakal merged 1 commit into
SKaiNET-developers:developfrom
michalharakal:fix/laya-loader-jvm-member

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

0.62.0 turned the JVM convenience LayaModelLoader.load(directory: Path, ctx, exactGelu, weightFormFor) into an extension on the common object. An extension needs an explicit import sk.ainet.models.laya.load, so every existing Kotlin caller of LayaModelLoader.load(dir, ctx, exactGelu = true) fails to compile against 0.62.0 (found while bumping the consumers: Daily-StandAPP and the SemanticEmojiFilter verifier both resolve the common member and report argument mismatches). The 0.62.0 notes claimed source compatibility; that was wrong.

Fix. LayaModelLoader is an expect object. The common suspend fun load(files, weights, ctx, exactGelu, weightForm, weightFormFor) keeps its signature and defaults on every target (actuals for JVM, Android, native, JS, wasmJs, wasmWasi delegate to one internal function), and the JVM actual adds the Path overload as a member, @JvmOverloads, so Java callers get the 0.61 load(Path, ExecutionContext, boolean) signature back too.

Verification. Every laya target compiles (JVM, JS, wasmJs, wasmWasi, linuxX64, linuxArm64, Android); apiDump regenerated — LayaModelLoaderKt is gone, LayaModelLoader.load(Path, …) is back with its three overloads; :llm-inference:laya:jvmTest green. The loader body is unchanged, so the FP32 and Q8_0 fixture results of #498 stand.

Intended for a 0.62.1 patch release against engine 0.61.0 (a transformers-only fix, per the versioning rule in the changelog).

0.62.0 made the JVM convenience an extension on the common object, which needs an explicit import
of sk.ainet.models.laya.load; every existing caller of LayaModelLoader.load(dir, ctx, exactGelu)
failed to compile. LayaModelLoader is an expect object now: the common suspend load is unchanged on
all targets (actuals for the JVM, Android, native, JS, wasmJs and wasmWasi), the JVM actual adds the
Path overload as a member, @jvmoverloads restoring the 0.61 Java signature. API dump regenerated;
every laya target compiles, jvmTest green.
@michalharakal
michalharakal merged commit 9db9317 into SKaiNET-developers:develop Oct 17, 2026
1 check passed
@michalharakal michalharakal mentioned this pull request Oct 17, 2026
michalharakal added a commit that referenced this pull request Oct 17, 2026
Transformers-only patch: the JVM LayaModelLoader.load(Path, …) member is back (#503). Changelog
entry, README current-release line, BOM coordinates in the docs, VERSION_NAME.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant