You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

quick_start.md 4.1 kB

[to #9061073] feat: merge tts to master Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9061073 Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9061073 * [to #41669377] docs and tools refinement and release 1. add build_doc linter script 2. add sphinx-docs support 3. add development doc and api doc 4. change version to 0.1.0 for the first internal release version Link: https://code.aone.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/8775307 * [to #41669377] add pipeline tutorial and fix bugs 1. add pipleine tutorial 2. fix bugs when using pipeline with certain model and preprocessor Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/8814301 * refine doc * refine doc * merge remote release/0.1 and fix conflict * Merge branch 'release/0.1' into 'nls/tts' Release/0.1 See merge request !1700968 * [Add] add tts preprocessor without requirements. finish requirements build later * [Add] add requirements and frd submodule * [Fix] remove models submodule * [Add] add am module * [Update] update am and vocoder * [Update] remove submodule * [Update] add models * [Fix] fix init error * [Fix] fix bugs with tts pipeline * merge master * [Update] merge from master * remove frd subdmoule and using wheel from oss * change scripts * [Fix] fix bugs in am and vocoder * [Merge] merge from master * Merge branch 'master' into nls/tts * [Fix] fix bugs * [Fix] fix pep8 * Merge branch 'master' into nls/tts * [Update] remove hparams and import configuration from kwargs * Merge branch 'master' into nls/tts * upgrade tf113 to tf115 * Merge branch 'nls/tts' of gitlab.alibaba-inc.com:Ali-MaaS/MaaS-lib into nls/tts * add multiple versions of ttsfrd * merge master * [Fix] fix cr comments * Merge branch 'master' into nls/tts * [Fix] fix cr comments 0617 * Merge branch 'master' into nls/tts * [Fix] remove comment out codes * [Merge] merge from master * [Fix] fix crash for incompatible tf and pytorch version, and frd using zip file resource * Merge branch 'master' into nls/tts * [Add] add cuda support
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. ModelScope Library目前支持tensorflow,pytorch深度学习框架进行模型训练、推理, 在Python 3.7+, Pytorch 1.8+, Tensorflow1.15,Tensorflow 2.x上测试可运行。
  2. **注: **`**语音相关**`**的功能仅支持 python3.7,tensorflow1.15的**`**linux**`**环境使用。 其他功能可以在windows、mac上安装使用。**
  3. ## python环境配置
  4. 首先,参考[文档](https://docs.anaconda.com/anaconda/install/) 安装配置Anaconda环境。
  5. 安装完成后,执行如下命令为modelscope library创建对应的python环境。
  6. ```shell
  7. conda create -n modelscope python=3.7
  8. conda activate modelscope
  9. ```
  10. ## 安装深度学习框架
  11. - 安装pytorch[参考链接](https://pytorch.org/get-started/locally/)。
  12. ```shell
  13. pip3 install torch torchvision torchaudio
  14. ```
  15. - 安装Tensorflow[参考链接](https://www.tensorflow.org/install/pip)。
  16. ```shell
  17. pip install --upgrade tensorflow
  18. ```
  19. ## ModelScope library 安装
  20. 注: 如果在安装过程中遇到错误,请前往[常见问题](faq.md)查找解决方案。
  21. ### pip安装
  22. 执行如下命令可以安装所有领域依赖:
  23. ```shell
  24. pip install "modelscope[cv,nlp,audio,multi-modal]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  25. ```
  26. 如仅需体验`语音功能`,请执行如下命令:
  27. ```shell
  28. pip install "modelscope[audio]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  29. ```
  30. 如仅需体验CV功能,可执行如下命令安装依赖:
  31. ```shell
  32. pip install "modelscope[cv]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  33. ```
  34. 如仅需体验NLP功能,可执行如下命令安装依赖:
  35. ```shell
  36. pip install "modelscope[nlp]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  37. ```
  38. 如仅需体验多模态功能,可执行如下命令安装依赖:
  39. ```shell
  40. pip install "modelscope[multi-modal]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  41. ```
  42. **注**:
  43. 1. `**语音相关**`**的功能仅支持 python3.7,tensorflow1.15的**`**linux**`**环境使用。 其他功能可以在windows、mac上安装使用。**
  44. 2. 语音领域中一部分模型使用了三方库SoundFile进行wav文件处理,**在Linux系统上用户需要手动安装SoundFile的底层依赖库libsndfile**,在Windows和MacOS上会自动安装不需要用户操作。详细信息可参考[SoundFile官网](https://github.com/bastibe/python-soundfile#installation)。以Ubuntu系统为>例,用户需要执行如下命令:
  45. ```shell
  46. sudo apt-get update
  47. sudo apt-get install libsndfile1
  48. ```
  49. 3. **CV功能使用需要安装mmcv-full, 请参考mmcv**[**安装手册**](https://github.com/open-mmlab/mmcv#installation)**进行安装**
  50. ### 使用源码安装
  51. 适合本地开发调试使用,修改源码后可以直接执行。
  52. ModelScope的源码可以直接clone到本地:
  53. ```shell
  54. git clone git@github.com:modelscope/modelscope.git
  55. cd modelscope
  56. git fetch origin master
  57. git checkout master
  58. ```
  59. 安装依赖
  60. 如需安装所有依赖,请执行如下命令
  61. ```shell
  62. pip install -e ".[cv,nlp,audio,multi-modal]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  63. ```
  64. 如需体验`语音功能`,请单独执行如下命令:
  65. ```shell
  66. pip install -e ".[audio]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  67. ```
  68. 如仅需体验CV功能,可执行如下命令安装依赖:
  69. ```shell
  70. pip install -e ".[cv]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  71. ```
  72. 如仅需体验NLP功能,可执行如下命令安装依赖:
  73. ```shell
  74. pip install -e ".[nlp]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  75. ```
  76. 如仅需体验多模态功能,可执行如下命令安装依赖:
  77. ```shell
  78. pip install -e ".[multi-modal]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  79. ```
  80. ### 安装验证
  81. 安装成功后,可以执行如下命令进行验证安装是否正确:
  82. ```shell
  83. python -c "from modelscope.pipelines import pipeline;print(pipeline('word-segmentation')('今天天气不错,适合 出去游玩'))"
  84. ```