模型版本
原能力
保留模型、参数、数据窗口、代码和制品版本,同版本不同内容应拒绝覆盖。(合同附件 R7 7.2)
首选项目
MLflow(Apache-2.0(开源仓库))。 MLflow
匹配范围
记录模型/运行制品并锁定数据和代码版本。
源码
MLflow · def get_model_version(
mlflow/tracking/client.py · 5162–5175 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def get_model_version(self, name: str, version: str) -> ModelVersion:
"""
Converts the docstring args and returns to google style.
Args:
name: Name of the containing registered model.
version: Version number as an integer of the model version.
Returns:
A single :py:class:`mlflow.entities.model_registry.ModelVersion` object.
.. code-block:: python
:caption: Example
DVC · def to_lockfile(
dvc/stage/serialize.py · 195–208 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def to_lockfile(stage: "PipelineStage", **kwargs) -> dict:
assert stage.name
return {stage.name: to_single_stage_lockfile(stage, **kwargs)}
def to_single_stage_file(stage: "Stage", **kwargs):
state = stage.dumpd(**kwargs)
# When we load a stage we parse yaml with a fast parser, which strips
# off all the comments and formatting. To retain those on update we do
# a trick here:
# - reparse the same yaml text with a slow but smart ruamel yaml parser
# - apply changes to a returned structure
# - serialize it
实现与验收要点
同一身份拒绝覆盖、历史标签可得性、权威输入哈希。