Class ModelCache
java.lang.Object
com.codename1.ai.inference.ModelCache
Downloads large LiteRT models once and exposes the cached file as a
ModelSource. Small models can instead be packaged directly with
ModelSource.resource(String).-
Method Summary
Modifier and TypeMethodDescriptionstatic AsyncResource<ModelSource> static AsyncResource<ModelSource> Fetches a model into the app-privateai-modelsdirectory.
-
Method Details
-
fetch
Fetches a model into the app-privateai-modelsdirectory.- Parameters:
url- HTTPS URL of the modelcacheKey- stable cache name, independent of the URLsha256- optional lowercase or uppercase SHA-256 hex digest- Returns:
- asynchronous cached model source
-
fetch
-