Skip to content

Commit

Permalink
Added support for Llama 3.1 Models
Browse files Browse the repository at this point in the history
  • Loading branch information
MananGandhi1810 committed Jul 29, 2024
1 parent d218316 commit d2aad49
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 4 deletions.
Binary file added .DS_Store
Binary file not shown.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@

## 1.3.5

- Fixed dangling dartdoc issue
- Fixed dangling dartdoc issue

## 1.4.0

- Added support for Llama 3.1 Models
5 changes: 5 additions & 0 deletions build/native_assets/macos/native_assets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
format-version:
- 1
- 0
- 0
native-assets: {}
Binary file added build/test_cache/build/cache.dill.track.dill
Binary file not shown.
Binary file added build/unit_test_assets/AssetManifest.bin
Binary file not shown.
1 change: 1 addition & 0 deletions build/unit_test_assets/AssetManifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions build/unit_test_assets/FontManifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Binary file added build/unit_test_assets/NOTICES.Z
Binary file not shown.
Binary file added build/unit_test_assets/shaders/ink_sparkle.frag
Binary file not shown.
5 changes: 4 additions & 1 deletion lib/src/text_chat/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ enum TextChatModels {
LLAMA_2_7B_CHAT_HF_LORA("@cf/meta-llama/llama-2-7b-chat-hf-lora"),

// LLAMA 3 8B INSTRUCT
LLAMA_3_8B_INSTRUCT("@hf/meta-llama/meta-llama-3-8b-instruct"),
LLAMA_3_8B_INSTRUCT("@cf/meta/llama-3-8b-instruct"),

// LLAMA 3 8B INSTRUCT
LLAMA_31_8B_INSTRUCT("@cf/meta/llama-3.1-8b-instruct"),

// UNA CYBERTRON 7B V2 BF16
UNA_CYBERTRON_7B_V2_BF16("@cf/fblgit/una-cybertron-7b-v2-bf16"),
Expand Down
5 changes: 4 additions & 1 deletion lib/src/text_generation/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ enum TextGenerationModels {
LLAMA_2_7B_CHAT_HF_LORA("@cf/meta-llama/llama-2-7b-chat-hf-lora"),

// LLAMA 3 8B INSTRUCT
LLAMA_3_8B_INSTRUCT("@hf/meta-llama/meta-llama-3-8b-instruct"),
LLAMA_3_8B_INSTRUCT("@cf/meta/llama-3-8b-instruct"),

// LLAMA 3 8B INSTRUCT
LLAMA_31_8B_INSTRUCT("@cf/meta/llama-3.1-8b-instruct"),

// UNA CYBERTRON 7B V2 BF16
UNA_CYBERTRON_7B_V2_BF16("@cf/fblgit/una-cybertron-7b-v2-bf16"),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cloudflare_ai
description: This is a Dart package for Cloudflare Workers AI. It currently supports Text Generation and Image Generation, Text Summarization, and Image Generation Models.
version: 1.3.5
version: 1.4.0
repository: https://github.com/MananGandhi1810/cloudflare-ai-dart

environment:
Expand Down
17 changes: 17 additions & 0 deletions test/cloudflare_ai_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ void main() {
Duration(minutes: 3),
),
);

test(
"Llama 3.1 8B Instruct",
() async {
TextGenerationModel model = TextGenerationModel(
accountId: accountId,
apiKey: apiKey,
model: TextGenerationModels.LLAMA_31_8B_INSTRUCT,
);
TextGenerationResponse res = await model.generateText("Hello!");
expect(res.result?.response, isNotNull);
expect(res.success, true);
},
timeout: Timeout(
Duration(minutes: 3),
),
);
});

group("Text Summarization:", () {
Expand Down

0 comments on commit d2aad49

Please sign in to comment.