Skip to content

FastVLM-0.5B support? #204

@YingjieHe

Description

@YingjieHe

Thanks for the plugin!!

I am wondering whether it supports FastVLM-0.5B litertlm model?

https://huggingface.co/litert-community/FastVLM-0.5B/tree/main

I had the following issue when try to use the fastvlm, from the log, it said the model was active

flutter: ℹ️  Model already installed: FastVLM-0.5B.litertlm (skipping download)
flutter: ✅ Set active inference model: FastVLM-0.5B
flutter: ✅ Inference model installed and set as active: FastVLM-0.5B

but then got

ERROR: The model is not a valid Flatbuffer buffer
E0000 00:00:1774586045.229607 1122263 model_data.cc:424] INTERNAL: RET_CHECK failure (third_party/odml/infra/genai/inference/utils/llm_utils/model_data.cc:424) model Error building tflite model.
Stack trace:
    @        0x104700ff0  util::StatusBuilder::ConditionallyLog()
    @        0x1047006c8  util::StatusBuilder::CreateStatusAndConditionallyLog()
    @        0x1040be2a0  absl::internal_statusor::StatusOrData<>::StatusOrData<>()
    @        0x1040bcc68  odml::infra::llm_utils::ModelData::Create()
    @        0x1047fa508  odml::infra::llm_utils::DeriveLlmModelSettingsStruct()
    @        0x1047cc2dc  odml::infra::LlmInferenceEngine::CreateLlmInferenceEngine()
    @        0x1047cc1b4  odml::infra::LlmInferenceEngine::CreateLlmInferenceEngine()
    @        0x1047c7d28  LlmInferenceEngine_CreateEngine
    @        0x104374788  $s19MediaPipeTasksGenAI13LlmTaskRunnerC13modelSettingsACSo0f5ModelJ0a_tKcfc
    @        0x1043746fc  $s19MediaPipeTasksGenAI13LlmTaskRunnerC13modelSettingsACSo0f5ModelJ0a_tKcfC
    @        0x10436e518  $s19MediaPipeTasksGenAI12LlmInferenceC7optionsA2C7OptionsC_tKcfcAA0F10TaskRunnerCSPys4Int8VGKXEfU_AhKKXEfU_AHSrySiGzKXEfU_AhKKXEfU_AhKKXEfU_
    @        0x1043708f4  $s19MediaPipeTasksGenAI12LlmInferenceC7optionsA2C7OptionsC_tKcfcAA0F10TaskRunnerCSPys4Int8VGKXEfU_AhKKXEfU_AHSrySiGzKXEfU_AhKKXEfU_TA
    @        0x10436e5c8  $sSS11withCStringyxxSPys4Int8VGKXEKlF19MediaPipeTasksGenAI13LlmTaskRunnerC_Tg5
    @        0x10436e27c  $s19MediaPipeTasksGenAI12LlmInferenceC7optionsA2C7OptionsC_tKcfcAA0F10TaskRunnerCSPys4Int8VGKXEfU_AhKKXEfU_
    @        0x1043707ec  $s19MediaPipeTasksGenAI12LlmInferenceC7optionsA2C7OptionsC_tKcfcAA0F10TaskRunnerCSPys4Int8VGKXEfU_AhKKXEfU_TA
    @        0x18938ed24  $ss11_StringGutsV16_slowWithCStringyxxSPys4Int8VGKXEKlF
    @        0x10436e61c  $sSS11withCStringyxxSPys4Int8VGKXEKlF19MediaPipeTasksGenAI13LlmTaskRunnerC_Tg5
    @        0x10436e170  $s19MediaPipeTasksGenAI12LlmInferenceC7optionsA2C7OptionsC_tKcfcAA0F10TaskRunnerCSPys4Int8VGKXEfU_TA
    @        0x18938ed24  $ss11_StringGutsV16_slowWithCStringyxxSPys4Int8VGKXEKlF
    @        0x10436e61c  $sSS11withCStringyxxSPys4Int8VGKXEKlF19MediaPipeTasksGenAI13LlmTaskRunnerC_Tg5
    @        0x10436e018  $s19MediaPipeTasksGenAI12LlmInferenceC7optionsA2C7OptionsC_tKcfc
    @        0x10436dd2c  $s19MediaPipeTasksGenAI12LlmInferenceC7optionsA2C7OptionsC_tKcfC
    @        0x10523b9fc  $s13flutter_gemma14InferenceModelV9modelPath9maxTokens18supportedLoraRanks0G9NumImagesACSS_SiSaySiGSgSitKcfC
    @        0x1052240d8  $s13flutter_gemma19PlatformServiceImplC11createModel9maxTokens9modelPath9loraRanks16preferredBackend0H9NumImages12supportAudio10completionys5Int64V_SSSayAMGSgAA09PreferredO0OSgAMSgSbSgys6ResultOyyts5Error_pGctFyyYbcfU_
    @        0x1052244d8  $s13flutter_gemma19PlatformServiceImplC11createModel9maxTokens9modelPath9loraRanks16preferredBackend0H9NumImages12supportAudio10completionys5Int64V_SSSayAMGSgAA09PreferredO0OSgAMSgSbSgys6ResultOyyts5Error_pGctFyyYbcfU_TA
    @        0x10435b0f0  $sIegh_IeyBh_TR
    @        0x1c4d00adc  904D48A3-D99E-3962-BFA9-C3DFB66BBA83
    @        0x1c4d1a7fc  904D48A3-D99E-3962-BFA9-C3DFB66BBA83
    @        0x1c4d3741c  904D48A3-D99E-3962-BFA9-C3DFB66BBA83
    @        0x1c4d130bc  904D48A3-D99E-3962-BFA9-C3DFB66BBA83
    @        0x1c4d136fc  904D48A3-D99E-3962-BFA9-C3DFB66BBA83
    @        0x1e8b4d37c  _pthread_wqthread
    @        0x1e8b4c8c0  start_wqthread
[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(failedToInitializeEngine(Optional("INTERNAL: RET_CHECK failure (third_party/odml/infra/genai/inference/utils/llm_utils/model_data.cc:424) model Error building tflite model.\n=== Source Location Trace: === \nthird_party/odml/infra/genai/inference/utils/llm_utils/model_data.cc:424\nthird_party/odml/infra/genai/inference/utils/llm_utils/config_utils.cc:558\nthird_party/odml/infra/genai/inference/llm_engine.cc:2132\n")), GenAiInferenceError, Stacktrace: ["0   Runner.debug.dylib                  0x000000010523e31c $s13flutter_gemma9wrapError33_AC1DF4B16F5474DCF2184B6087243948LLySayypSgGypF + 1856", "1   Runner.debug.dylib                  0x0000000105245b70 $s13flutter_gemma20PlatformServiceSetupC5setUp15binaryMessenger3api20messageChannelSuffixySo013FlutterBinaryI0_p_AA0cD0_pSgSStFZyypSg_yAKctcfU_ys6ResultOyyts5Error_pGcfU_ + 332", "2   Runner.debug.dylib                  0x00000001052245c4 $s13flutter_gemma19PlatformServiceImplC11createModel9maxTokens9modelPath9loraRanks16preferredBackend0H9NumImages12supportAudio10completionys5Int64V_SSSayAMGSgAA09PreferredO0OSgAMSgSbSgys6ResultOyyts5Error_pGctFyyYbcfU_yyScMYccfU0_ + 96", "3   Runner.debug.dylib                  0x0000000104359b1c $sIeg_IeyB_TR + 48", "4   libdispatch.dylib                   0x00000001c4d00adc 904D48A3-D99E-3962-BFA9-C3DFB66BBA83 + 6876", "5   libdispatch.dylib                   0x00000001c4d1a7fc 904D48A3-D99E-3962-BFA9-C3DFB66BBA83 + 112636", "6   libdispatch.dylib                   0x00000001c4d37b10 904D48A3-D99E-3962-BFA9-C3DFB66BBA83 + 232208", "7   libdispatch.dylib                   0x00000001c4d0fec8 904D48A3-D99E-3962-BFA9-C3DFB66BBA83 + 69320", "8   libdispatch.dylib                   0x00000001c4d0fe04 _dispatch_main_queue_callback_4CF + 44", "9   CoreFoundation                      0x000000018c0412b4 2F32D384-4637-3018-843E-4FC875B865C4 + 434868", "10  CoreFoundation                      0x000000018bff4b3c 2F32D384-4637-3018-843E-4FC875B865C4 + 121660", "11  CoreFoundation                      0x000000018bff3a6c 2F32D384-4637-3018-843E-4FC875B865C4 + 117356", "12  GraphicsServices                    0x0000000230991498 GSEventRunModal + 120", "13  UIKitCore                           0x0000000191aa3df8 C768F963-A0CC-3F5C-A1D3-2E06D53A2381 + 646648", "14  UIKitCore                           0x0000000191a4ce54 UIApplicationMain + 336", "15  UIKitCore                           0x0000000191b78938 C768F963-A0CC-3F5C-A1D3-2E06D53A2381 + 1517880", "16  Runner.debug.dylib                  0x0000000104355cf8 $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 128", "17  Runner.debug.dylib                  0x0000000104355c68 $s6Runner11AppDelegateC5$mainyyFZ + 44", "18  Runner.debug.dylib                  0x0000000104355d74 __debug_main_executable_dylib_entry_point + 28", "19  dyld                                0x0000000188fcee28 8ACDB580-8AB7-38C0-A586-E667ADB1C11C + 20008"], null)
#0      PlatformService.createModel (package:flutter_gemma/pigeon.g.dart:202:7)
<asynchronous suspension>
#1      FlutterGemmaMobile.createModel (package:flutter_gemma/mobile/flutter_gemma_mobile.dart:313:7)
<asynchronous suspension>
#2      FlutterGemma.getActiveModel (package:flutter_gemma/core/api/flutter_gemma.dart:257:12)

Other info:

IOS: 26.3.1

flutter_gemma: 0.12.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions