您的位置:首页 > 游戏 > 游戏 > 服务器相关总结

服务器相关总结

2024/10/6 4:03:12 来源:https://blog.csdn.net/lf_78910jqk/article/details/140555513  浏览:    关键词:服务器相关总结

文章目录

    • conda 安装
    • 镜像源总结(手动加)
    • 创建环境
    • 安装pytorch
    • 安装transformers

conda 安装

查看conda版本

conda --version

查看当前conda的配置文件位置

conda config --show

编辑配置文件,默认路径是~/condarc

vim ~/.condarc 

在channels字段添加新的镜像源,例如清华镜像

channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro- defaults

显示所有的channel

conda config --show channels

添加清华镜像源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes

镜像源总结(手动加)

-i https://pypi.tuna.tsinghua.edu.cn/simple

创建环境

创建名为 myenv 的新虚拟环境
conda create --name myenv创建名为 myenv 的新虚拟环境,并指定 Python 版本为3.8
conda create --name myenv python=3.8激活创建好的虚拟环境
conda activate myenv

安装pytorch

pytorch官网

conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia

安装transformers

pip install transformers
pip install transformers==2.7.0

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com