From d2f4d5ad6eec2e8705e9a9d3c9498b4e8ad31f1c Mon Sep 17 00:00:00 2001 From: danemadsen Date: Sat, 8 Jun 2024 14:34:18 +1000 Subject: [PATCH] update llama.cpp --- .metadata | 27 +++++++++++++++++++++------ lib/classes/llama_cpp_model.dart | 7 ++----- linux/my_application.cc | 20 ++++++++++++++++++++ packages/flutter | 2 +- packages/maid_llm | 2 +- pubspec.lock | 24 ++++++++++++------------ 6 files changed, 57 insertions(+), 25 deletions(-) diff --git a/.metadata b/.metadata index c609cbe65..d594245e9 100644 --- a/.metadata +++ b/.metadata @@ -4,8 +4,8 @@ # 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 @@ -13,11 +13,26 @@ project_type: app 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 diff --git a/lib/classes/llama_cpp_model.dart b/lib/classes/llama_cpp_model.dart index 4b2865b92..fdebeac8a 100644 --- a/lib/classes/llama_cpp_model.dart +++ b/lib/classes/llama_cpp_model.dart @@ -101,9 +101,7 @@ class LlamaCppModel extends LargeLanguageModel { } if (useDefault) { - GptParams gptParams = GptParams(); - gptParams.model = uri; - return gptParams; + return GptParams(uri); } SamplingParams samplingParams = SamplingParams(); @@ -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; @@ -131,7 +129,6 @@ class LlamaCppModel extends LargeLanguageModel { gptParams.nBatch = nBatch; gptParams.nKeep = nKeep; gptParams.sparams = samplingParams; - gptParams.model = uri; return gptParams; } diff --git a/linux/my_application.cc b/linux/my_application.cc index 5f7befe7f..e962c63f5 100644 --- a/linux/my_application.cc +++ b/linux/my_application.cc @@ -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); @@ -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; } diff --git a/packages/flutter b/packages/flutter index 300451ada..761747bfc 160000 --- a/packages/flutter +++ b/packages/flutter @@ -1 +1 @@ -Subproject commit 300451adae589accbece3490f4396f10bdf15e6e +Subproject commit 761747bfc538b5af34aa0d3fac380f1bc331ec49 diff --git a/packages/maid_llm b/packages/maid_llm index 499fb5a22..6f502868e 160000 --- a/packages/maid_llm +++ b/packages/maid_llm @@ -1 +1 @@ -Subproject commit 499fb5a229afead908cda074059358babbd806e3 +Subproject commit 6f502868ee219484dde0cc0c645b6150882c5116 diff --git a/pubspec.lock b/pubspec.lock index 69f41a5eb..303edeb2a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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 @@ -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: @@ -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: @@ -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: @@ -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: @@ -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"