-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
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 _initLlama() async {
final modelPath = await copyAssetToFile('assets/models/small.gguf');
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');
}
}
`
Metadata
Metadata
Assignees
Labels
No labels