Skip to content

Commit

Permalink
Merge pull request #8 from danemadsen/sequence
Browse files Browse the repository at this point in the history
Fix sequenceFilter and add abstract classes for different formats
  • Loading branch information
netdur authored Jan 25, 2024
2 parents 3ce4d61 + c2d768b commit 1d54faf
Show file tree
Hide file tree
Showing 10 changed files with 1,894 additions and 2,371 deletions.
1 change: 1 addition & 0 deletions lib/llama_cpp_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export 'src/model_params.dart';
export 'src/context_params.dart';
export 'src/llama.dart';
export 'src/llama_processor.dart';
export 'src/prompt_format.dart';
8 changes: 8 additions & 0 deletions lib/src/alpaca_format.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'prompt_format.dart';
import 'sequence_filter.dart';

class AlpacaFormat extends PromptFormat {
AlpacaFormat()
: super(PromptFormatType.alpaca,
[SequenceFilter('### Input:'), SequenceFilter('### Response:')]);
}
11 changes: 11 additions & 0 deletions lib/src/chatml_format.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'prompt_format.dart';
import 'sequence_filter.dart';

class ChatMLFormat extends PromptFormat {
ChatMLFormat()
: super(PromptFormatType.chatml, [
SequenceFilter('<|im_start|>user'),
SequenceFilter('<|im_end|>'),
SequenceFilter('<|im_start|>assistant')
]);
}
Loading

0 comments on commit 1d54faf

Please sign in to comment.