Skip to content

Commit

Permalink
first output
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Feb 4, 2025
1 parent b7b3644 commit 1bb5897
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'dart:async';

import 'package:file_picker/file_picker.dart';
import 'package:llama/bindings.dart';
import 'package:llama/llama.dart';

void main() {
Expand Down Expand Up @@ -59,8 +58,6 @@ class _LlamaAppState extends State<LlamaApp> {
)
);

print('LlamaCPP created');

Stream<String> stream = llamaCpp.prompt(_messages);

setState(() {
Expand Down
4 changes: 4 additions & 0 deletions lib/src/llama_cpp_native.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ class LlamaCppNative {
}

Stream<String> prompt(List<ChatMessage> messages) async* {
assert(_model != ffi.nullptr, 'Model is not loaded');
assert(_context != ffi.nullptr, 'Context is not initialized');
assert(_sampler != ffi.nullptr, 'Sampler is not initialized');

_completer = Completer();

final nCtx = lib.llama_n_ctx(_context);
Expand Down

0 comments on commit 1bb5897

Please sign in to comment.