Melange
API ReferenceiOS

ZeticMLangeHFModel

API reference for loading Hugging Face models on iOS.

This page reflects ZeticMLange iOS 1.9.0.

ZeticMLangeHFModel loads compatible models directly from Hugging Face repositories.

Import

import ZeticMLange

Initializer

public init(
  _ repoId: String,
  userAccessToken: String? = nil,
  index: Int = 0,
  cacheHandlingPolicy: ModelCacheHandlingPolicy = .REMOVE_OVERLAPPING
) async throws
ParameterTypeDefaultDescription
repoIdString-Hugging Face repository ID.
userAccessTokenString?nilOptional Hugging Face access token.
indexInt0Model index when a repository contains multiple entries.
cacheHandlingPolicyModelCacheHandlingPolicy.REMOVE_OVERLAPPINGManaged artifact cache cleanup policy.
let model = try await ZeticMLangeHFModel("zetic-ai/yolov11n")

run(inputs:)

public func run(inputs: [Tensor] = []) throws -> [Tensor]

Runs inference and returns output tensors.

Lifecycle

public private(set) var isClosed: Bool
public func close()

Call close() when the model is no longer needed.

On this page