Skip to content

Commit

Permalink
Merge pull request #511 from danemadsen/main
Browse files Browse the repository at this point in the history
check localhost
  • Loading branch information
danemadsen authored Apr 24, 2024
2 parents ee95041 + acd299a commit c8fce65
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/classes/ollama_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ class OllamaModel extends LargeLanguageModel {

@override
Future<void> resetUri() async {
// Check Localhost
if ((await _checkIpForOllama('127.0.0.1')).isNotEmpty) {
uri = 'http://127.0.0.1:11434';
notifyListeners();
return;
}

// If ip is set, check if it's valid
if (_ip.isNotEmpty && (await _checkIpForOllama(_ip)).isNotEmpty) {
uri = 'http://$_ip:11434';
notifyListeners();
Expand Down

0 comments on commit c8fce65

Please sign in to comment.