parent
6e26718f36
commit
519fc27f26
|
@ -4,12 +4,12 @@ import 'dart:io';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
import 'package:ollama_app/worker/clients.dart';
|
|
||||||
import 'desktop.dart';
|
import 'desktop.dart';
|
||||||
import 'haptic.dart';
|
import 'haptic.dart';
|
||||||
import '../main.dart';
|
import '../main.dart';
|
||||||
import 'sender.dart';
|
import 'sender.dart';
|
||||||
import 'theme.dart';
|
import 'theme.dart';
|
||||||
|
import 'clients.dart';
|
||||||
|
|
||||||
import 'package:ollama_app/l10n/gen/app_localizations.dart';
|
import 'package:ollama_app/l10n/gen/app_localizations.dart';
|
||||||
|
|
||||||
|
@ -37,16 +37,21 @@ void setModel(BuildContext context, Function setState) {
|
||||||
seconds:
|
seconds:
|
||||||
(10.0 * (prefs!.getDouble("timeoutMultiplier") ?? 1.0)).round()));
|
(10.0 * (prefs!.getDouble("timeoutMultiplier") ?? 1.0)).round()));
|
||||||
for (var i = 0; i < list.models!.length; i++) {
|
for (var i = 0; i < list.models!.length; i++) {
|
||||||
|
var details = await ollamaClient.showModelInfo(
|
||||||
|
request: llama.ModelInfoRequest(model: list.models![i].model!));
|
||||||
models.add(list.models![i].model!.split(":")[0]);
|
models.add(list.models![i].model!.split(":")[0]);
|
||||||
modelsReal.add(list.models![i].model!);
|
modelsReal.add(list.models![i].model!);
|
||||||
modal.add((list.models![i].details!.families ?? []).contains("clip"));
|
modal.add((list.models![i].details!.families ?? []).contains("clip") ||
|
||||||
|
(details.capabilities ?? []).contains("vision"));
|
||||||
}
|
}
|
||||||
|
|
||||||
addIndex = models.length;
|
addIndex = models.length;
|
||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
models.add(AppLocalizations.of(context)!.modelDialogAddModel);
|
models.add(AppLocalizations.of(context)!.modelDialogAddModel);
|
||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
modelsReal.add(AppLocalizations.of(context)!.modelDialogAddModel);
|
modelsReal.add(AppLocalizations.of(context)!.modelDialogAddModel);
|
||||||
modal.add(false);
|
modal.add(false);
|
||||||
|
|
||||||
for (var i = 0; i < modelsReal.length; i++) {
|
for (var i = 0; i < modelsReal.length; i++) {
|
||||||
if (modelsReal[i] == model) {
|
if (modelsReal[i] == model) {
|
||||||
usedIndex = i;
|
usedIndex = i;
|
||||||
|
|
24
pubspec.lock
24
pubspec.lock
|
@ -185,22 +185,6 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.2"
|
version: "1.3.2"
|
||||||
fetch_api:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: fetch_api
|
|
||||||
sha256: "97f46c25b480aad74f7cc2ad7ccba2c5c6f08d008e68f95c1077286ce243d0e6"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.2.0"
|
|
||||||
fetch_client:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: fetch_client
|
|
||||||
sha256: "9666ee14536778474072245ed5cba07db81ae8eb5de3b7bf4a2d1e2c49696092"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.2"
|
|
||||||
ffi:
|
ffi:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -426,10 +410,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: http
|
name: http
|
||||||
sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f
|
sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.4.0"
|
||||||
http_parser:
|
http_parser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -610,10 +594,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: ollama_dart
|
name: ollama_dart
|
||||||
sha256: "4e40bc499b6fe46ba54a004d2da601c40bd73d66e3f18cf7b03225ccf3d481a6"
|
sha256: df4acde50fc4a055134f91919505d801170c2e1e5df798056a18e2811f20307b
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.2+1"
|
version: "0.2.4"
|
||||||
package_info_plus:
|
package_info_plus:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -12,7 +12,7 @@ dependencies:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
ollama_dart: ^0.2.1
|
ollama_dart: ^0.2.4
|
||||||
intl: any
|
intl: any
|
||||||
shared_preferences: ^2.2.3
|
shared_preferences: ^2.2.3
|
||||||
flutter_chat_ui: ^1.6.13
|
flutter_chat_ui: ^1.6.13
|
||||||
|
|
Loading…
Reference in New Issue