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
Download android/app/src/test/java/com/laya/LayaSerializationParityTest.kt from litert-community/Laya-Multilingual-LiteRT: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/litert-community/Laya-Multilingual-LiteRT/resolve/main/android/app/src/test/java/com/laya/LayaSerializationParityTest.kt
- Command line
-
hf download hf://litert-community/Laya-Multilingual-LiteRT/android/app/src/test/java/com/laya/LayaSerializationParityTest.kt
-
curl -L -o LayaSerializationParityTest.kt https://huggingface.co/litert-community/Laya-Multilingual-LiteRT/resolve/main/android/app/src/test/java/com/laya/LayaSerializationParityTest.kt
1.13 kB
| // SPDX-License-Identifier: Apache-2.0 | |
| package com.laya | |
| import org.junit.Assert.assertEquals | |
| import org.junit.Test | |
| class LayaSerializationParityTest { | |
| 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) | |
| } | |
| } | |