Skip to content
代码片段 群组 项目
提交 b1c35b84 编辑于 作者: fdegier's avatar fdegier
浏览文件

Model registry: Add default experiment to model card

Changelog: added
上级 edc67dec
No related branches found
No related tags found
无相关合并请求
...@@ -43,6 +43,10 @@ class ModelType < ::Types::BaseObject ...@@ -43,6 +43,10 @@ class ModelType < ::Types::BaseObject
field :candidates, ::Types::Ml::CandidateType.connection_type, null: true, field :candidates, ::Types::Ml::CandidateType.connection_type, null: true,
description: 'Version candidates of the model.' description: 'Version candidates of the model.'
field :default_experiment_path, ::GraphQL::Types::String,
null: true,
description: 'Path to default experiment page for the model.'
field :version, ::Types::Ml::ModelVersionType, null: true, field :version, ::Types::Ml::ModelVersionType, null: true,
description: 'Version of the model.', description: 'Version of the model.',
resolver: ::Resolvers::Ml::FindModelVersionResolver resolver: ::Resolvers::Ml::FindModelVersionResolver
......
...@@ -34,6 +34,10 @@ def path ...@@ -34,6 +34,10 @@ def path
project_ml_model_path(model.project, model.id) project_ml_model_path(model.project, model.id)
end end
def default_experiment_path
project_ml_experiment_path(model.project, model.default_experiment)
end
private private
def latest_version def latest_version
......
...@@ -29342,6 +29342,7 @@ Machine learning model in the model registry. ...@@ -29342,6 +29342,7 @@ Machine learning model in the model registry.
| <a id="mlmodelcandidatecount"></a>`candidateCount` | [`Int`](#int) | Count of candidates in the model. | | <a id="mlmodelcandidatecount"></a>`candidateCount` | [`Int`](#int) | Count of candidates in the model. |
| <a id="mlmodelcandidates"></a>`candidates` | [`MlCandidateConnection`](#mlcandidateconnection) | Version candidates of the model. (see [Connections](#connections)) | | <a id="mlmodelcandidates"></a>`candidates` | [`MlCandidateConnection`](#mlcandidateconnection) | Version candidates of the model. (see [Connections](#connections)) |
| <a id="mlmodelcreatedat"></a>`createdAt` | [`Time!`](#time) | Date of creation. | | <a id="mlmodelcreatedat"></a>`createdAt` | [`Time!`](#time) | Date of creation. |
| <a id="mlmodeldefaultexperimentpath"></a>`defaultExperimentPath` | [`String`](#string) | Path to default experiment page for the model. |
| <a id="mlmodeldescription"></a>`description` | [`String`](#string) | Description of the model. | | <a id="mlmodeldescription"></a>`description` | [`String`](#string) | Description of the model. |
| <a id="mlmodeldescriptionhtml"></a>`descriptionHtml` | [`String`](#string) | GitLab Flavored Markdown rendering of `description`. | | <a id="mlmodeldescriptionhtml"></a>`descriptionHtml` | [`String`](#string) | GitLab Flavored Markdown rendering of `description`. |
| <a id="mlmodelid"></a>`id` | [`MlModelID!`](#mlmodelid) | ID of the model. | | <a id="mlmodelid"></a>`id` | [`MlModelID!`](#mlmodelid) | ID of the model. |
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
} }
description description
descriptionHtml descriptionHtml
defaultExperimentPath
name name
versionCount versionCount
candidateCount candidateCount
...@@ -65,6 +66,7 @@ ...@@ -65,6 +66,7 @@
} }
description description
descriptionHtml descriptionHtml
defaultExperimentPath
name name
versionCount versionCount
candidateCount candidateCount
...@@ -113,6 +115,8 @@ ...@@ -113,6 +115,8 @@
'description' => 'A description', 'description' => 'A description',
'descriptionHtml' => 'descriptionHtml' =>
'<p data-sourcepos="1:1-1:13" dir="auto">A description</p>', '<p data-sourcepos="1:1-1:13" dir="auto">A description</p>',
'defaultExperimentPath' =>
"/#{project.full_path}/-/ml/experiments/#{model.default_experiment.id}",
'latestVersion' => { 'latestVersion' => {
'id' => model_version_id 'id' => model_version_id
}, },
...@@ -143,6 +147,8 @@ ...@@ -143,6 +147,8 @@
'description' => model_markdown.description, 'description' => model_markdown.description,
'descriptionHtml' => 'descriptionHtml' =>
'<p data-sourcepos="1:1-1:17" dir="auto">A <strong data-sourcepos="1:3-1:17">description</strong></p>', '<p data-sourcepos="1:1-1:17" dir="auto">A <strong data-sourcepos="1:3-1:17">description</strong></p>',
'defaultExperimentPath' =>
"/#{project_markdown.full_path}/-/ml/experiments/#{model_markdown.default_experiment.id}",
'latestVersion' => { 'latestVersion' => {
'id' => model_version_id_markdown 'id' => model_version_id_markdown
}, },
......
...@@ -99,4 +99,10 @@ ...@@ -99,4 +99,10 @@
it { is_expected.to eq(model1.user) } it { is_expected.to eq(model1.user) }
end end
describe '#default_experiment_path' do
subject { model1.present.default_experiment_path }
it { is_expected.to eq("/#{model1.project.full_path}/-/ml/experiments/#{model1.default_experiment.id}") }
end
end end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册