Skip to content

Commit

Permalink
Add tablet screenshots (#491)
Browse files Browse the repository at this point in the history
* add reset model button

* seed default param ollama

* add tablet screenshots

* update images
  • Loading branch information
danemadsen authored Apr 14, 2024
1 parent 3cb4d7b commit 4d14ae9
Show file tree
Hide file tree
Showing 18 changed files with 102 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions lib/classes/anthropic_claude_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,9 @@ class ClaudeModel extends LargeLanguageModel {
prefs.setString("mistral_ai_model", json.encode(toMap()));
});
}

@override
void reset() {
fromMap({});
}
}
5 changes: 5 additions & 0 deletions lib/classes/google_gemini_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,9 @@ class GoogleGeminiModel extends LargeLanguageModel {
prefs.setString("google_gemini_model", json.encode(toMap()));
});
}

@override
void reset() {
fromMap({});
}
}
4 changes: 4 additions & 0 deletions lib/classes/large_language_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ class LargeLanguageModel extends ChangeNotifier {
throw UnimplementedError();
}

void reset() {
fromMap({});
}

void save() {
throw UnimplementedError();
}
Expand Down
7 changes: 6 additions & 1 deletion lib/classes/llama_cpp_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class LlamaCppModel extends LargeLanguageModel {
@override
void fromMap(Map<String, dynamic> json) {
super.fromMap(json);
_promptFormat = PromptFormat.values[json['promptFormat']];
_promptFormat = PromptFormat.values[json['promptFormat'] ?? PromptFormat.alpaca.index];
notifyListeners();
}

Expand Down Expand Up @@ -183,4 +183,9 @@ class LlamaCppModel extends LargeLanguageModel {
uri = '';
notifyListeners();
}

@override
void reset() {
fromMap({});
}
}
5 changes: 5 additions & 0 deletions lib/classes/mistral_ai_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,9 @@ class MistralAiModel extends LargeLanguageModel {
prefs.setString("mistral_ai_model", json.encode(toMap()));
});
}

@override
void reset() {
fromMap({});
}
}
6 changes: 6 additions & 0 deletions lib/classes/ollama_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class OllamaModel extends LargeLanguageModel {
baseUrl: '$uri/api',
defaultOptions: ChatOllamaOptions(
model: name,
seed: seed
),
);
} else {
Expand Down Expand Up @@ -273,4 +274,9 @@ class OllamaModel extends LargeLanguageModel {
prefs.setString("ollama_model", json.encode(toMap()));
});
}

@override
void reset() {
fromMap({});
}
}
5 changes: 5 additions & 0 deletions lib/classes/open_ai_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,9 @@ class OpenAiModel extends LargeLanguageModel {
prefs.setString("open_ai_model", json.encode(toMap()));
});
}

@override
void reset() {
fromMap({});
}
}
13 changes: 13 additions & 0 deletions lib/ui/mobile/pages/platforms/gemini_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ class GoogleGeminiPage extends StatelessWidget {

return ListView(
children: [
Align(
alignment: Alignment.center, // Center the button horizontally
child: FilledButton(
onPressed: () {
session.model.reset();
},
child: Text(
"Reset",
style: Theme.of(context).textTheme.labelLarge,
),
),
),
const SizedBox(height: 10.0),
const ApiKeyParameter(),
Divider(
height: 20,
Expand Down
13 changes: 13 additions & 0 deletions lib/ui/mobile/pages/platforms/llama_cpp_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ class _LlamaCppPageState extends State<LlamaCppPage> {
),
),
const SizedBox(height: 15.0),
Align(
alignment: Alignment.center, // Center the button horizontally
child: FilledButton(
onPressed: () {
session.model.reset();
},
child: Text(
"Reset",
style: Theme.of(context).textTheme.labelLarge,
),
),
),
const SizedBox(height: 10.0),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expand Down
13 changes: 13 additions & 0 deletions lib/ui/mobile/pages/platforms/mistralai_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ class MistralAiPage extends StatelessWidget {

return ListView(
children: [
Align(
alignment: Alignment.center, // Center the button horizontally
child: FilledButton(
onPressed: () {
session.model.reset();
},
child: Text(
"Reset",
style: Theme.of(context).textTheme.labelLarge,
),
),
),
const SizedBox(height: 10.0),
const ApiKeyParameter(),
Divider(
height: 20,
Expand Down
15 changes: 14 additions & 1 deletion lib/ui/mobile/pages/platforms/ollama_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ class OllamaPage extends StatelessWidget {

return ListView(
children: [
Align(
alignment: Alignment.center, // Center the button horizontally
child: FilledButton(
onPressed: () {
session.model.reset();
},
child: Text(
"Reset",
style: Theme.of(context).textTheme.labelLarge,
),
),
),
const SizedBox(height: 10.0),
const ApiKeyParameter(),
Divider(
height: 20,
Expand All @@ -54,6 +67,7 @@ class OllamaPage extends StatelessWidget {
),
const UrlParameter(),
const SizedBox(height: 8.0),
const SeedParameter(),
const UseDefaultParameter(),
if (!session.model.useDefault) ...[
const SizedBox(height: 20.0),
Expand All @@ -64,7 +78,6 @@ class OllamaPage extends StatelessWidget {
color: Theme.of(context).colorScheme.primary,
),
const PenalizeNlParameter(),
const SeedParameter(),
const NThreadsParameter(),
const NCtxParameter(),
const NBatchParameter(),
Expand Down
13 changes: 13 additions & 0 deletions lib/ui/mobile/pages/platforms/openai_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ class OpenAiPage extends StatelessWidget {

return ListView(
children: [
Align(
alignment: Alignment.center, // Center the button horizontally
child: FilledButton(
onPressed: () {
session.model.reset();
},
child: Text(
"Reset",
style: Theme.of(context).textTheme.labelLarge,
),
),
),
const SizedBox(height: 10.0),
const ApiKeyParameter(),
Divider(
height: 20,
Expand Down

0 comments on commit 4d14ae9

Please sign in to comment.