You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The readme says that the model should be under the file's root directory, but the flutter_gemma plugin code refers to the app's document directory.
I could run this plugin after manually moving the model file to the app's document.
Here's the code I use to move the model file.
final docDir =awaitgetApplicationDocumentsDirectory();
final model =await rootBundle.load('assets/model.bin');
final modelBytes = model.buffer.asUint8List(model.offsetInBytes, model.lengthInBytes);
awaitFile(p.join(docDir.path, 'model.bin')).writeAsBytes(modelBytes);
And also, line 17 of ios/classes/InferenceModel.swift should be
self.inference =try!LlmInference(options: llmOptions)
or
Use do/ catch
in case the model file does not exist.
The text was updated successfully, but these errors were encountered:
The readme says that the model should be under the file's root directory, but the flutter_gemma plugin code refers to the app's document directory.
I could run this plugin after manually moving the model file to the app's document.
Here's the code I use to move the model file.
And also, line 17 of
ios/classes/InferenceModel.swift
should bein case the model file does not exist.
The text was updated successfully, but these errors were encountered: