error.py 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. # Copyright (c) Alibaba, Inc. and its affiliates.
  2. # docstyle-ignore
  3. AUDIO_IMPORT_ERROR = """
  4. Audio model import failed: {0}, if you want to use audio related function, please execute
  5. `pip install modelscope[audio] -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html`
  6. """
  7. # docstyle-ignore
  8. PROTOBUF_IMPORT_ERROR = """
  9. {0} requires the protobuf library but it was not found in your environment. Checkout the instructions on the
  10. installation page of its repo: https://github.com/protocolbuffers/protobuf/tree/master/python#installation and
  11. follow the ones that match your environment.
  12. """
  13. # docstyle-ignore
  14. SENTENCEPIECE_IMPORT_ERROR = """
  15. {0} requires the SentencePiece library but it was not found in your environment. Checkout the instructions on the
  16. installation page of its repo: https://github.com/google/sentencepiece#installation and follow the ones
  17. that match your environment.
  18. """
  19. # docstyle-ignore
  20. SKLEARN_IMPORT_ERROR = """
  21. {0} requires the scikit-learn library but it was not found in your environment. You can install it with:
  22. ```
  23. pip install -U scikit-learn
  24. ```
  25. In a notebook or a colab, you can install it by executing a cell with
  26. ```
  27. !pip install -U scikit-learn
  28. ```
  29. """
  30. # docstyle-ignore
  31. TENSORFLOW_IMPORT_ERROR = """
  32. {0} requires the TensorFlow library but it was not found in your environment. Checkout the instructions on the
  33. installation page: https://www.tensorflow.org/install and follow the ones that match your environment.
  34. """
  35. # docstyle-ignore
  36. TENSORFLOW_IMPORT_WARNING = """
  37. {0} requires the TensorFlow library but it was not found in your environment.
  38. If you don't want to use them, please ignore this message
  39. If you want to use them, please Checkout the instructions on the
  40. installation page: https://www.tensorflow.org/install and follow the ones that match your environment.
  41. """
  42. # docstyle-ignore
  43. TIMM_IMPORT_ERROR = """
  44. {0} requires the timm library but it was not found in your environment. You can install it with pip:
  45. `pip install timm`
  46. """
  47. # docstyle-ignore
  48. TOKENIZERS_IMPORT_ERROR = """
  49. {0} requires the 🤗 Tokenizers library but it was not found in your environment. You can install it with:
  50. ```
  51. pip install tokenizers
  52. ```
  53. In a notebook or a colab, you can install it by executing a cell with
  54. ```
  55. !pip install tokenizers
  56. ```
  57. """
  58. # docstyle-ignore
  59. PYTORCH_IMPORT_ERROR = """
  60. {0} requires the PyTorch library but it was not found in your environment. Checkout the instructions on the
  61. installation page: https://pytorch.org/get-started/locally/ and follow the ones that match your environment.
  62. """
  63. WENETRUNTIME_IMPORT_ERROR = """
  64. {0} requires the wenetruntime library but it was not found in your environment. You can install it with pip:
  65. `pip install wenetruntime==TORCH_VER`
  66. """
  67. # docstyle-ignore
  68. SCIPY_IMPORT_ERROR = """
  69. {0} requires the scipy library but it was not found in your environment. You can install it with pip:
  70. `pip install scipy`
  71. """
  72. # docstyle-ignore
  73. OPENCV_IMPORT_ERROR = """
  74. {0} requires the opencv library but it was not found in your environment. You can install it with pip:
  75. `pip install opencv-python`
  76. """
  77. PILLOW_IMPORT_ERROR = """
  78. {0} requires the Pillow library but it was not found in your environment. You can install it with pip:
  79. `pip install Pillow`
  80. """
  81. GENERAL_IMPORT_ERROR = """
  82. {0} requires the REQ library but it was not found in your environment. You can install it with pip:
  83. `pip install REQ`
  84. """
  85. DECORD_IMPORT_ERROR = """
  86. {0} requires the decord library but it was not found in your environment. You can install it with pip:
  87. `pip install decord>=0.6.0`
  88. """
  89. # docstyle-ignore
  90. DEEPSPEED_IMPORT_ERROR = """
  91. {0} requires the Deepspeed library but it was not found in your environment. Checkout the instructions on the
  92. installation page: https://www.deepspeed.ai/tutorials/advanced-install/ and follow the ones that match your environment.
  93. """
  94. # docstyle-ignore
  95. FAIRSEQ_IMPORT_ERROR = """
  96. {0} requires the fairseq library but it was not found in your environment.
  97. You can install it with pip on linux:
  98. `pip install fairseq`
  99. On windows, please checkout the instructions on the
  100. installation page: https://github.com/facebookresearch/fairseq and follow the ones that match your environment.
  101. """
  102. # docstyle-ignore
  103. FASTTEXT_IMPORT_ERROR = """
  104. {0} requires the fasttext library but it was not found in your environment.
  105. You can install it with pip on linux or mac:
  106. `pip install fasttext`
  107. Or you can checkout the instructions on the
  108. installation page: https://github.com/facebookresearch/fastText and follow the ones that match your environment.
  109. """
  110. # docstyle-ignore
  111. EASYNLP_IMPORT_ERROR = """
  112. {0} requires the easynlp library but it was not found in your environment.
  113. You can install it with pip on linux or mac:
  114. `pip install pai-easynlp -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html`
  115. Or you can checkout the instructions on the
  116. installation page: https://github.com/alibaba/EasyNLP and follow the ones that match your environment.
  117. """
  118. # docstyle-ignore
  119. MEGATRON_UTIL_IMPORT_ERROR = """
  120. {0} requires the megatron_util library but it was not found in your environment. You can install it with pip:
  121. `pip install megatron_util -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html`
  122. """
  123. # docstyle-ignore
  124. TEXT2SQL_LGESQL_IMPORT_ERROR = """
  125. {0} requires the text2sql_lgesql library but it was not found in your environment. You can install it with pip:
  126. `pip install text2sql_lgesql -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html`
  127. """
  128. # docstyle-ignore
  129. MPI4PY_IMPORT_ERROR = """
  130. {0} requires the mpi4py library but it was not found in your environment. You can install it with pip:
  131. `pip install mpi4py' and with following the instruction to install openmpi,
  132. https://docs.open-mpi.org/en/v5.0.x/installing-open-mpi/quickstart.html`
  133. """
  134. # docstyle-ignore
  135. OPENCLIP_IMPORT_ERROR = """
  136. {0} requires the fasttext library but it was not found in your environment.
  137. You can install it with pip on linux or mac:
  138. `pip install open_clip_torch`
  139. Or you can checkout the instructions on the
  140. installation page: https://github.com/mlfoundations/open_clip and follow the ones that match your environment.
  141. """
  142. # docstyle-ignore
  143. TAMING_IMPORT_ERROR = """
  144. {0} requires the timm library but it was not found in your environment. You can install it with pip:
  145. `pip install taming-transformers-rom1504`
  146. """
  147. # docstyle-ignore
  148. XFORMERS_IMPORT_ERROR = """
  149. {0} requires the timm library but it was not found in your environment. You can install it with pip:
  150. `pip install xformers>=0.0.17`
  151. """
  152. # docstyle-ignore
  153. SWIFT_IMPORT_ERROR = """
  154. {0} requires the ms-swift library but it was not found in your environment. You can install it with pip:
  155. `pip install ms-swift -U`
  156. """