mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-18 01:14:53 +00:00
* Seeding the SRV-backed model should happen inside an initializer. * Keep the model up to date when the hidden setting changes. * Use the correct Mixtral model name and fix previous data migration. * URL validation should trigger only when we attempt to update it.
19 lines
494 B
Ruby
19 lines
494 B
Ruby
# frozen_string_literal: true
|
|
class FixVllmModelName < ActiveRecord::Migration[7.1]
|
|
def up
|
|
vllm_mixtral_model_id = DB.query_single(<<~SQL).first
|
|
SELECT id FROM llm_models WHERE name = 'mistralai/Mixtral'
|
|
SQL
|
|
|
|
DB.exec(<<~SQL, target_id: vllm_mixtral_model_id) if vllm_mixtral_model_id
|
|
UPDATE llm_models
|
|
SET name = 'mistralai/Mixtral-8x7B-Instruct-v0.1'
|
|
WHERE id = :target_id
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|