Skip to content

Commit

Permalink
update llama.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Jun 8, 2024
1 parent 974d654 commit d2f4d5a
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 25 deletions.
27 changes: 21 additions & 6 deletions .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,35 @@
# This file should be version controlled and should not be manually edited.

version:
revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3"
channel: "stable"
revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
channel: "[user-branch]"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: android
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: ios
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: linux
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: macos
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: web
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: windows
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49

# User provided section

Expand Down
7 changes: 2 additions & 5 deletions lib/classes/llama_cpp_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ class LlamaCppModel extends LargeLanguageModel {
}

if (useDefault) {
GptParams gptParams = GptParams();
gptParams.model = uri;
return gptParams;
return GptParams(uri);
}

SamplingParams samplingParams = SamplingParams();
Expand All @@ -122,7 +120,7 @@ class LlamaCppModel extends LargeLanguageModel {
samplingParams.mirostatEta = mirostatEta;
samplingParams.penalizeNl = penalizeNewline;

GptParams gptParams = GptParams();
GptParams gptParams = GptParams(uri);
gptParams.seed = seed != 0 ? seed : Random().nextInt(1000000);
gptParams.nThreads = nThread;
gptParams.nThreadsBatch = nThread;
Expand All @@ -131,7 +129,6 @@ class LlamaCppModel extends LargeLanguageModel {
gptParams.nBatch = nBatch;
gptParams.nKeep = nKeep;
gptParams.sparams = samplingParams;
gptParams.model = uri;

return gptParams;
}
Expand Down
20 changes: 20 additions & 0 deletions linux/my_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@ static gboolean my_application_local_command_line(GApplication* application, gch
return TRUE;
}

// Implements GApplication::startup.
static void my_application_startup(GApplication* application) {
//MyApplication* self = MY_APPLICATION(object);

// Perform any actions required at application startup.

G_APPLICATION_CLASS(my_application_parent_class)->startup(application);
}

// Implements GApplication::shutdown.
static void my_application_shutdown(GApplication* application) {
//MyApplication* self = MY_APPLICATION(object);

// Perform any actions required at application shutdown.

G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application);
}

// Implements GObject::dispose.
static void my_application_dispose(GObject* object) {
MyApplication* self = MY_APPLICATION(object);
Expand All @@ -91,6 +109,8 @@ static void my_application_dispose(GObject* object) {
static void my_application_class_init(MyApplicationClass* klass) {
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
G_APPLICATION_CLASS(klass)->startup = my_application_startup;
G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown;
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter
Submodule flutter updated 2063 files
24 changes: 12 additions & 12 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ packages:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: c6b0b4c05c458e1c01ad9bcc14041dd7b1f6783d487be4386f793f47a8a4d03e
sha256: "8cf40eebf5dec866a6d1956ad7b4f7016e6c0cc69847ab946833b7d43743809f"
url: "https://pub.dev"
source: hosted
version: "2.0.20"
version: "2.0.19"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -609,10 +609,10 @@ packages:
dependency: transitive
description:
name: path_provider_android
sha256: "9c96da072b421e98183f9ea7464898428e764bc0ce5567f27ec8693442e72514"
sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d
url: "https://pub.dev"
source: hosted
version: "2.2.5"
version: "2.2.4"
path_provider_foundation:
dependency: transitive
description:
Expand Down Expand Up @@ -761,10 +761,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_android
sha256: "93d0ec9dd902d85f326068e6a899487d1f65ffcd5798721a95330b26c8131577"
sha256: "1ee8bf911094a1b592de7ab29add6f826a7331fb854273d55918693d5364a1f2"
url: "https://pub.dev"
source: hosted
version: "2.2.3"
version: "2.2.2"
shared_preferences_foundation:
dependency: transitive
description:
Expand Down Expand Up @@ -910,10 +910,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
sha256: ceb2625f0c24ade6ef6778d1de0b2e44f2db71fded235eb52295247feba8c5cf
sha256: "17cd5e205ea615e2c6ea7a77323a11712dffa0720a8a90540db57a01347f9ad9"
url: "https://pub.dev"
source: hosted
version: "6.3.3"
version: "6.3.2"
url_launcher_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -1014,10 +1014,10 @@ packages:
dependency: transitive
description:
name: win32
sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4
sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb"
url: "https://pub.dev"
source: hosted
version: "5.5.1"
version: "5.5.0"
win32_registry:
dependency: transitive
description:
Expand Down Expand Up @@ -1051,5 +1051,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.4.0 <4.0.0"
flutter: ">=3.22.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"

0 comments on commit d2f4d5a

Please sign in to comment.