Instructions to use litert-community/Laya-Multilingual-LiteRT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/Laya-Multilingual-LiteRT with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Laya
How to use litert-community/Laya-Multilingual-LiteRT with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
File size: 1,132 Bytes
eae8f62 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | // SPDX-License-Identifier: Apache-2.0
package com.laya
import org.junit.Assert.assertEquals
import org.junit.Test
class LayaSerializationParityTest {
@Test
fun allTwentyStatesMatchPythonJsonDumps() {
val data = LayaJson.asObject(LayaTestData.read("fixtures/serialization_reference.json"))
val cases = LayaJson.asArray(data["cases"]).map(LayaJson::asObject)
assertEquals(20, cases.size)
val details =
cases.map { case ->
val actual = LayaPromptBuilder.serializeState(case["state"])
linkedMapOf<String, Any?>(
"id" to case["id"],
"exact" to (actual == case["serialized"]),
"expected" to case["serialized"],
"actual" to actual,
)
}
val failures = details.filter { it["exact"] != true }
LayaTestData.report(
"jvm_serialization_parity.json",
linkedMapOf(
"status" to if (failures.isEmpty()) "PASS" else "FAIL",
"cases" to cases.size,
"exact" to cases.size - failures.size,
"details" to details,
),
)
LayaTestData.assertNoFailures("serialize_state parity", failures)
}
}
|