diff --git a/modelscope/models/nlp/mglm/requirements.txt b/modelscope/models/nlp/mglm/requirements.txt index e44ae5d1..55e58e75 100644 --- a/modelscope/models/nlp/mglm/requirements.txt +++ b/modelscope/models/nlp/mglm/requirements.txt @@ -7,7 +7,6 @@ ftfy langdetect lsh matplotlib -mpi4py nltk pandas regex diff --git a/modelscope/utils/error.py b/modelscope/utils/error.py index ee4a9aad..44e6b238 100644 --- a/modelscope/utils/error.py +++ b/modelscope/utils/error.py @@ -146,3 +146,10 @@ TEXT2SQL_LGESQL_IMPORT_ERROR = """ {0} requires the text2sql_lgesql library but it was not found in your environment. You can install it with pip: `pip install text2sql_lgesql -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html` """ + +# docstyle-ignore +MPI4PY_IMPORT_ERROR = """ +{0} requires the mpi4py library but it was not found in your environment. You can install it with pip: +`pip install mpi4py' and with following the instruction to install openmpi, +https://docs.open-mpi.org/en/v5.0.x/installing-open-mpi/quickstart.html` +""" diff --git a/modelscope/utils/import_utils.py b/modelscope/utils/import_utils.py index 5622579e..3517ea3d 100644 --- a/modelscope/utils/import_utils.py +++ b/modelscope/utils/import_utils.py @@ -303,6 +303,7 @@ REQUIREMENTS_MAAPING = OrderedDict([ MEGATRON_UTIL_IMPORT_ERROR)), ('text2sql_lgesql', (is_package_available('text2sql_lgesql'), TEXT2SQL_LGESQL_IMPORT_ERROR)), + ('mpi4py', (is_package_available('mpi4py'), MPI4PY_IMPORT_ERROR)), ]) SYSTEM_PACKAGE = set(['os', 'sys', 'typing'])