LlamaParent.init() is taking a very long time
After 2 days finally I managed to configure the project according to this package but when I called LlamaParent.init() it is taking soooo much time.
here is my code snippet:
`
Future
Llama.libraryPath = "assets/libllama.so";
final load = LlamaLoad(
path: modelPath,
modelParams: ModelParams()..useMemorymap = false,
contextParams: ContextParams(),
samplingParams: SamplerParams(),
format: ChatMLFormat(),
);
try {
_llamaParent = LlamaParent(load);
log("model loaded");
log("model init called at ${DateTime.now().hour}:${DateTime.now().minute}");
await _llamaParent.init();
log("model init completed at ${DateTime.now().hour}:${DateTime.now().minute}");
_sub = _llamaParent.stream.listen((token) {
log('stream message: $token');
setState(() => _botText += token);
});
} catch (e) {
_showError('Failed to initialize LLM:\n$e');
}
}
`
I used a button to send Prompt and then init was completed as soon as I hit the button for sending the prompt. But now I am getting error inside stream Here are my logs:
[log] process prompt called: Hi [log] response: 1745924511840 [log] stream message: ERROR: Null check operator used on a null value
Also please @netdur can you guide me how to run large models of sizes like 2 3 GB on any user device ? Because we can not build app with such large models inside assets
@mnawazshah on play store you can deliver model using Play Asset Delivery also check code in examples