From b661b62c36198ab30601c4a7b02a10d841ea1c16 Mon Sep 17 00:00:00 2001 From: Vadser Date: Wed, 21 Aug 2024 11:07:16 +0200 Subject: [PATCH] Add stream: false to ollama default configuration --- app/helpers/model_versions_helper.rb | 2 +- app/javascript/controllers/model_controller.js | 2 +- app/views/model_versions/_form.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/model_versions_helper.rb b/app/helpers/model_versions_helper.rb index a01bfeb..4cf142b 100644 --- a/app/helpers/model_versions_helper.rb +++ b/app/helpers/model_versions_helper.rb @@ -3,7 +3,7 @@ module ModelVersionsHelper DEFAULT_CONFIGURATION = { 'openai' => '{"model":"gpt-3.5-turbo","temperature":0.5}', - 'ollama' => '{"model":"llama3.1"}', + 'ollama' => '{"model":"llama3.1", "stream": false}', 'llama_cpp' => '{"n_predict":500,"temperature":0.5,"stop":["<|end|>","<|user|>","<|assistant|>","<|endoftext|>","<|system|>"]}' }.freeze diff --git a/app/javascript/controllers/model_controller.js b/app/javascript/controllers/model_controller.js index 487cce3..b6303c6 100644 --- a/app/javascript/controllers/model_controller.js +++ b/app/javascript/controllers/model_controller.js @@ -1,7 +1,7 @@ import { Controller } from "@hotwired/stimulus" const DEFAULT_CONFIGURATION = { openai: '{"model":"gpt-3.5-turbo","temperature":0.5}', - ollama: '{"model":"llama3.1"}', + ollama: '{"model":"llama3.1", "stream": false}', llama_cpp: '{"n_predict":500,"temperature":0.5,"stop":["<|end|>","<|user|>","<|assistant|>","<|endoftext|>","<|system|>"]}' } diff --git a/app/views/model_versions/_form.html.erb b/app/views/model_versions/_form.html.erb index e6c3d22..c831d6e 100644 --- a/app/views/model_versions/_form.html.erb +++ b/app/views/model_versions/_form.html.erb @@ -13,7 +13,7 @@
<%= form.label :configuration %> - <%= form.text_field :configuration, value: JSON::dump(model_version&.configuration) || default_configuration(@model.executor_type), class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %> + <%= form.text_field :configuration, value: model_version&.configuration ? JSON::dump(model_version&.configuration) : default_configuration(@model.executor_type), class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>