首先建立新环境
conda create -n myenv python=3.8
安装numpy和pytorch
conda install numpy
conda install pytorch torchvision torchaudio cpuonly -c pytorch -c conda-forge
其余的一些环境配置
huggingface_hub 0.16.4 py_0 huggingface
importlib-metadata 6.0.0 py38haa95532_0 defaults
如果版本不对可能会报奇怪错误
安装transformers
conda install -c huggingface transformers
conda install -c huggingface datasets
transformers入门demo(转自清华大学大模型网课)
https://colab.research.google.com/drive/1tcDiyHIKgEJp4TzGbGp27HYbdFWGolU_#scrollTo=ybucJuvjW9eF