Melange
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.ZeticMLangeHFModel

Constructor

ZeticMLangeHFModel(
    context: Context,
    repoId: String,
    userAccessToken: String? = null,
    manifestDir: String? = null,
    index: Int = 0,
)
ParameterTypeDefaultDescription
contextContext-Android context used for cache and file access.
repoIdString-Hugging Face repository ID.
userAccessTokenString?nullOptional Hugging Face access token.
manifestDirString?nullOptional local manifest directory.
indexInt0Model 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.

On this page