API ReferenceAndroid
ZeticMLangeHFModel
API reference for loading Hugging Face models on Android.
This page reflects ZeticMLange Android 1.9.0.
ZeticMLangeHFModel loads compatible models directly from Hugging Face repositories.
Import
import com.zeticai.mlange.core.model.ZeticMLangeHFModelConstructor
ZeticMLangeHFModel(
context: Context,
repoId: String,
userAccessToken: String? = null,
manifestDir: String? = null,
index: Int = 0,
)| Parameter | Type | Default | Description |
|---|---|---|---|
context | Context | - | Android context used for cache and file access. |
repoId | String | - | Hugging Face repository ID. |
userAccessToken | String? | null | Optional Hugging Face access token. |
manifestDir | String? | null | Optional local manifest directory. |
index | Int | 0 | Model index when a repository contains multiple entries. |
val model = ZeticMLangeHFModel(
context = context,
repoId = "zetic-ai/yolov11n",
)run(inputs)
fun run(inputs: Array<Tensor> = emptyArray()): Array<Tensor>Runs inference and returns output tensors.
Lifecycle
val isClosed: Boolean
fun close()Call close() when the model is no longer needed.