Skip to content
Snippets Groups Projects
Verified Commit 8f456549 authored by Bruno Cardoso's avatar Bruno Cardoso Committed by GitLab
Browse files

Add fallback to experimental label

parent c5300deb
No related branches found
No related tags found
3 merge requests!181325Fix ambiguous `created_at` in project.rb,!180187Draft: Update dashboard editing to save visualizations directly to the dashboard file,!180071Add fallback to experimental label
......@@ -58,7 +58,7 @@ def identifier
end
def release_state
MODELS_RELEASE_STATE[self[:model].to_sym]
MODELS_RELEASE_STATE[self[:model]&.to_sym] || RELEASE_STATE_EXPERIMENTAL
end
def ga?
......
......@@ -50,10 +50,22 @@
end
describe '#release_state' do
subject(:self_hosted_model) { build(:ai_self_hosted_model, model: :deepseekcoder) }
Ai::SelfHostedModel::MODELS_RELEASE_STATE.each do |model, expected_state|
context "when model is #{model}" do
subject(:self_hosted_model) { build(:ai_self_hosted_model, model: model) }
it 'returns release state of model' do
expect(self_hosted_model.release_state).to eq('BETA')
it "returns #{expected_state}" do
expect(self_hosted_model.release_state).to eq(expected_state)
end
end
end
context 'when model is not listed in MODELS_RELEASE_STATE' do
subject(:self_hosted_model) { build(:ai_self_hosted_model, model: nil) }
it 'returns EXPERIMENTAL as default release state' do
expect(self_hosted_model.release_state).to eq(Ai::SelfHostedModel::RELEASE_STATE_EXPERIMENTAL)
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment