File tree Expand file tree Collapse file tree
app/src/main/kotlin/com/google/ai/sample/feature/multimodal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -347,14 +347,21 @@ class PhotoReasoningViewModel(
347347 ensureLiteRtNativeLoaded()
348348 if (liteRtEngine == null ) {
349349 val liteRtBackend = if (backend == InferenceBackend .GPU ) Backend .GPU else Backend .CPU
350+ val visionBackend = Backend .CPU
351+ val audioBackend = Backend .CPU
350352 val engineConfig = EngineConfig (
351353 modelPath = modelFile.absolutePath,
352354 backend = liteRtBackend,
355+ visionBackend = visionBackend,
356+ audioBackend = audioBackend,
357+ maxNumTokens = null ,
353358 cacheDir = context.cacheDir.absolutePath
354359 )
355360 Log .i(
356361 TAG ,
357- " Creating LiteRT engine with backend=$liteRtBackend cacheDir=${context.cacheDir.absolutePath} "
362+ " Creating LiteRT engine with backend=$liteRtBackend , " +
363+ " visionBackend=$visionBackend , audioBackend=$audioBackend , " +
364+ " cacheDir=${context.cacheDir.absolutePath} "
358365 )
359366 liteRtEngine = Engine (engineConfig).also { it.initialize() }
360367 Log .d(TAG , " Offline model initialized with LiteRT-LM Engine backend=$liteRtBackend " )
You can’t perform that action at this time.
0 commit comments