Skip to content

Commit

Permalink
llama_cpp_page
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Jun 27, 2024
1 parent 7c156fc commit 72f566f
Showing 1 changed file with 12 additions and 40 deletions.
52 changes: 12 additions & 40 deletions lib/ui/desktop/side_panels/model_settings/llama_cpp_panel.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:maid/classes/providers/large_language_model.dart';
import 'package:maid/classes/providers/large_language_models/llama_cpp_model.dart';
import 'package:maid/classes/providers/app_data.dart';
import 'package:maid/ui/desktop/parameters/penalize_nl_parameter.dart';
import 'package:maid/ui/desktop/parameters/template_parameter.dart';
Expand All @@ -22,7 +21,6 @@ import 'package:maid/ui/desktop/parameters/top_k_parameter.dart';
import 'package:maid/ui/desktop/parameters/top_p_parameter.dart';
import 'package:maid/ui/desktop/parameters/typical_p_parameter.dart';
import 'package:maid/ui/desktop/parameters/seed_parameter.dart';
import 'package:maid/ui/shared/dialogs/storage_operation_dialog.dart';
import 'package:maid/ui/shared/utilities/session_busy_overlay.dart';
import 'package:provider/provider.dart';

Expand All @@ -44,9 +42,18 @@ class LlamaCppPanel extends StatelessWidget {
child: ListView(
padding: const EdgeInsets.all(8.0),
children: [
buildModelName(),
const SizedBox(height: 10.0),
buildButtons(context),
Align(
alignment: Alignment.center,
child: FilledButton(
onPressed: () {
LargeLanguageModel.of(context).reset();
},
child: Text(
"Reset",
style: Theme.of(context).textTheme.labelLarge,
),
),
),
buildDivider(context),
buildWrap(),
buildDivider(context),
Expand Down Expand Up @@ -78,41 +85,6 @@ class LlamaCppPanel extends StatelessWidget {
);
}

Widget buildButtons(BuildContext context) {
return Wrap(
alignment: WrapAlignment.center,
spacing: 8,
runSpacing: 6,
children: [
FilledButton(
onPressed: () {
LargeLanguageModel.of(context).reset();
},
child: const Text(
"Reset"
),
),
FilledButton(
onPressed: () => showDialog(
context: context,
builder: (context) => StorageOperationDialog(future: LlamaCppModel.of(context).loadModel())
),
child: const Text(
"Load GGUF"
),
),
FilledButton(
onPressed: () {
LargeLanguageModel.of(context).resetUri();
},
child: const Text(
"Unload GGUF"
),
),
],
);
}

Widget buildModelName() {
return Consumer<AppData>(
builder: (context, appData, child) {
Expand Down

0 comments on commit 72f566f

Please sign in to comment.