|
|
|
@@ -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 <https://pip.pypa.io/en/stable/user_guide/#requirements-files>`_. |
|
|
|
|
|
|
|
|
|
|
|
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<components/spec:Semantic Specification>` for more details), |
|
|
|
you can easily upload your learnware to the ``Learnware Market`` with a single line of code: |
|
|
|
|
|
|
|
.. code-block:: python |
|
|
|
|