Windows系統(tǒng)rwkv的lora微調(diào)【wls2】

簡介裝不下了我再補(bǔ)充幾句疑難雜癥
一、遇到微軟商店報錯0x80131500,參考:
https://www.reneelab.com.cn/code-0x80131500.html
https://blog.csdn.net/hhxy_wlzx/article/details/128792651
或關(guān)了魔法
----------------------------------------------------------
二、wsl2的cuda地址
11.7:https://developer.nvidia.com/cuda-11-7-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=deb_local
最新:https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=deb_local
----------------------------------------------------------
三、torch安裝:
1.13.1:pip install torch==1.13.1 --extra-index-url https://download.pytorch.org/whl/cu117 --upgrade
最新:pip install torch --extra-index-url https://download.pytorch.org/whl/cu117 --upgrade
----------------------------------------------------------
四、conda創(chuàng)建環(huán)境報錯【solving environment: failed with repodata from current_repodata.json, will retry with next repodata】:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
上面不行就換回默認(rèn)源多試幾次:
conda config --remove-key channels
----------------------------------------------------------
五、限制wsl2占比過高的方法
在用戶目錄下 C:\Users\Administrator(根據(jù)你自己的用戶名來)新建一個 .wslconfig文件
內(nèi)容:
[wsl2]
memory=4GB #僅分配給WSL內(nèi)存3GB
processors=1 #僅使用的核心數(shù)量
swap=4GB #設(shè)置交換分區(qū)僅4GB
localhostForwarding=true
上面參數(shù)根據(jù)實(shí)際需求進(jìn)行調(diào)整
----------------------------------------------------------
六、使用
當(dāng)你部署完以后第二次想要微調(diào)時,只需以下三步
1.打開Ubuntu,根據(jù)你的需求cd進(jìn)相應(yīng)目錄
2.進(jìn)入環(huán)境:conda activate train
3.直接輸入你需要的代碼(數(shù)據(jù)轉(zhuǎn)換、lora微調(diào)等),這個環(huán)境通用性比較強(qiáng),其他rwkv的項(xiàng)目用這個環(huán)境應(yīng)該也是沒問題的。