当前位置: 首页 > news >正文

centos-LLM-生物信息-BioGPT安装

参考
GitHub - microsoft/BioGPT
https://github.com/microsoft/BioGPT

BioGPT:用于生物医学文本生成和挖掘的生成式预训练转换器 |生物信息学简报 |牛津学术 — BioGPT: generative pre-trained transformer for biomedical text generation and mining | Briefings in Bioinformatics | Oxford Academic
https://academic.oup.com/bib/article/23/6/bbac409/6713511

No such file or directory: 'fairseq\version.txt · Issue #5518 · facebookresearch/fairseq
https://github.com/facebookresearch/fairseq/issues/5518

环境
centos 7,anaconda3,CUDA 11.6


目录

  • 问题描述
  • 安装
    • PyTorch
      • 安装 CUDA Toolkit 11.6
      • 安装PyTorch
    • fairseq
      • 报错:FileNotFoundError: [Errno 2] No such file or directory: 'fairseq/version.txt'
    • Moses
    • fastBPE
    • sacremoses
    • sklearn

问题描述

BioGPT,是一个在大规模生物医学文献上预先训练的特定领域的生成 Transformer 语言模型。

本文介绍了它在本地服务器上的安装过程,下一篇文章将会写具体用法。

安装

要求:(来自github页面readme)

  1. Python version == 3.10
  2. PyTorch version == 1.12.0
  3. fairseq version == 0.12.0(要先装PyTorch)
  4. Moses
  5. fastBPE
  6. sacremoses
  7. sklearn

PyTorch

安装 CUDA Toolkit 11.6

手动下载 CUDA Toolkit 11.6

wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run
sudo sh cuda_11.6.0_510.39.01_linux.run

安装的时候会有选项,这样选:
在这里插入图片描述
然后选择Install。

这个要选择哪个?选择Choose components to upgrade

Existing installation of CUDA Toolkit 11.6 found:                            
x Upgrade all                                                                  
x Choose components to upgrade                                                 
x No, abort installation   

设置环境变量:

echo 'export PATH=/usr/local/cuda-11.6/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc

安装PyTorch

使用清华源。

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0

检查PyTorch能否识别GPU:输出True就对了

python -c "import torch; print(torch.cuda.is_available())"

fairseq

pip --default-timeout=1000 install fairseq -i https://pypi.tuna.tsinghua.edu.cn/simple

有可能需要:

sudo yum install -y python3-devel gcc g++ make cmake
pip install cython -i https://pypi.tuna.tsinghua.edu.cn/simple

官方的做法是下面。但我试了,1是要科学上网,2是会报错:TimeoutError: The read operation timed out或者ERROR: Could not find a version that satisfies the requirement cython (from versions: none)。安装了cython也不行。

git clone https://github.com/pytorch/fairseq
cd fairseq
pip install --editable ./

# on MacOS:
# CFLAGS="-stdlib=libc++" pip install --editable ./

# to install the latest stable release (0.10.x)
# pip install fairseq

报错:FileNotFoundError: [Errno 2] No such file or directory: ‘fairseq/version.txt’

完整报错:

  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      Traceback (most recent call last):
        File "/home/xxx/anaconda3/envs/biogpt/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
        File "/home/xxx/anaconda3/envs/biogpt/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
        File "/home/xxx/anaconda3/envs/biogpt/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-ubaynszi/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "/tmp/pip-build-env-ubaynszi/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-ubaynszi/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 27, in <module>
        File "<string>", line 18, in write_version_py
      FileNotFoundError: [Errno 2] No such file or directory: 'fairseq/version.txt'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

原因:参考下面的链接,是pip版本太高了,我的pip是25.0.1,降到24就可以了。
No such file or directory: 'fairseq\version.txt · Issue #5518 · facebookresearch/fairseq
https://github.com/facebookresearch/fairseq/issues/5518

python -m pip install pip==24.0 

Moses

git clone https://github.com/moses-smt/mosesdecoder.git
export MOSES=${PWD}/mosesdecoder

fastBPE

git clone https://github.com/glample/fastBPE.git
export FASTBPE=${PWD}/fastBPE
cd fastBPE
g++ -std=c++11 -pthread -O3 fastBPE/main.cc -IfastBPE -o fast

sacremoses

pip install sacremoses

sklearn

pip install scikit-learn -i https://pypi.tuna.tsinghua.edu.cn/simple
http://www.dtcms.com/a/122053.html

相关文章:

  • RecyclerView 和 ListView从 设计理念、性能优化 和 扩展能力 三个维度展开分析
  • 基于开源 AI 大模型 AI 智能名片 S2B2C 商城小程序的京城首家无人智慧书店创新模式研究
  • 编码常见的 3类 23种设计模式——学习笔记
  • python处理excel文件
  • 127.0.0.1本地环回地址(Loopback Address)
  • LeetCode 相交链表题解:双指针的精妙应用
  • 我的NISP二级之路-04
  • 系统分析师(二)--操作系统
  • CD24.【C++ Dev】类和对象(15)初始化列表(下)和对象隐式类型转换
  • 深入理解Spring是如何解决循环依赖的
  • [250409] GitHub Copilot 全面升级,推出AI代理模式,可支援MCP | Devin 2.0 发布
  • 数据库管理工具实战:IDEA 与 DBeaver 连接 TDengine(一)
  • Vue2-实现elementUI的select全选功能
  • 卷积神经网络(CNN)基础
  • MicroPython 开发ESP32应用教程 之 WIFI、BLE共用常见问题处理及中断处理函数注意事项
  • 基于视觉密码的加密二值图像可逆数据隐藏
  • 颠覆传统!复旦微软联合研发MagicMotion,重新定义图生视频可能性
  • 品牌出海新思路:TikTok Shop东南亚FACT经营矩阵实操指南
  • 游戏开发中 C#、Python 和 C++ 的比较
  • 六、继承(二)
  • JavaScript学习教程,从入门到精通,JavaScript 运算符及语法知识点详解(8)
  • 2025年Java无服务器架构实战:AWS Lambda与Spring Cloud Function深度整合
  • uniapp 打包 H5 向 打包的APP 使用 @dcloudio/uni-webview-js 传值
  • 数据结构实验4.3:利用队列实现杨辉三角的输出
  • BOTA六维力矩传感器在三层AI架构中的集成实践:从数据采集到力控闭环
  • 绿算技术团队受邀出席英伟达GTC2025大会丨重塑AI存储新范式
  • 【android bluetooth 框架分析 01】【关键线程 3】【bt_jni_thread 线程介绍】
  • MySQL多表查询实战指南:从SQL到XML映射的完整实现(2W+字深度解析)
  • [Windows] Gopeed-v1.7.0
  • HashMap、LinkedHashMap与TreeMap的核心特性与使用场景总结