From b26dd5d2246c8372dbeab166a6cefbacc22da2de Mon Sep 17 00:00:00 2001 From: zouxiaochuan Date: Wed, 12 Jul 2023 18:21:38 +0800 Subject: [PATCH] [MNT] modify doc for learnware environment --- docs/conf.py | 3 +++ docs/workflow/submit.rst | 34 +++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7d1e5e4..68ccb4d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,8 +19,11 @@ extensions = [ "sphinx.ext.todo", "sphinx.ext.mathjax", "sphinx.ext.napoleon", + "sphinx.ext.autosectionlabel", ] +autosectionlabel_prefix_document = True + language = "en_US" # Add any paths that contain templates here, relative to this directory. diff --git a/docs/workflow/submit.rst b/docs/workflow/submit.rst index 39eb137..7726346 100644 --- a/docs/workflow/submit.rst +++ b/docs/workflow/submit.rst @@ -106,24 +106,35 @@ how your learnware configuration file should be structured based on our previous kwargs: {} -``environment.yaml`` --------------------- +``environment.yaml`` or ``requirements.txt`` +-------------------------------------------- -In this YAML file, you need to specify the conda environment configuration for running your model -(if the model environment is incompatible, you can rely on this for manual configuration). -You can generate this file according to the following steps: +In order to allow others to run your learnware, you need to specify the dependencies of your model. You +can either provide an ``environment.yaml`` file or an ``requirements.txt`` file. -- Create env config for conda: + +- ``environment.yaml`` for conda: + + if you provide ``environment.yaml``, a new conda environment will be created according to this file + when users install your learnware. The yaml file can be generated by the following command: .. code-block:: conda env export | grep -v "^prefix: " > environment.yaml - -- Recover env from config: - .. code-block:: - conda env create -f environment.yaml +- ``requirements.txt`` for pip: + + if you provide ``requirements.txt``, dependent packages will be installed through -r option of pip. + More description of ``requirements.txt`` can be found in + `pip documentation `_. + + +It is recommended to use ``environment.yaml`` which can reduce conflics between different packages. + +.. note:: + Wether you use ``environment.yaml`` or ``requirements.txt``, you should make the dependencies as minimal as possible. + You may need to open the file and delete unnecessary packages manually. Upload Learnware @@ -131,7 +142,8 @@ Upload Learnware Once you have prepared the four required files mentioned above, you can package them as your own learnware zipfile. Combined with the generated semantic specification that -briefly describes the features of your task and model (Please refer to :ref:`semantic_specification` for more details), +briefly describes the features of your task and model ( +Please refer to :ref:`semantic specification` for more details), you can easily upload your learnware to the ``Learnware Market`` with a single line of code: .. code-block:: python