diff options
Diffstat (limited to 'app/services/ml/experiment_tracking')
-rw-r--r-- | app/services/ml/experiment_tracking/candidate_repository.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/services/ml/experiment_tracking/candidate_repository.rb b/app/services/ml/experiment_tracking/candidate_repository.rb index 1dbeb30145b..f1fd93d7816 100644 --- a/app/services/ml/experiment_tracking/candidate_repository.rb +++ b/app/services/ml/experiment_tracking/candidate_repository.rb @@ -14,9 +14,10 @@ module Ml ::Ml::Candidate.with_project_id_and_iid(project.id, iid) end - def create!(experiment, start_time, tags = nil) + def create!(experiment, start_time, tags = nil, name = nil) candidate = experiment.candidates.create!( user: user, + name: candidate_name(name, tags), start_time: start_time || 0 ) @@ -85,6 +86,13 @@ module Ml entity_class.insert_all(entities, returning: false) unless entities.empty? end + + def candidate_name(name, tags) + return name if name.present? + return unless tags.present? + + tags.detect { |t| t[:key] == 'mlflow.runName' }&.dig(:value) + end end end end |