赞
踩
下载模型
chinese-alpaca-2-7b-hf下载完成的模型需要放置在项目下的models目录下
下载最新的显卡驱动
英伟达2060显卡驱动需要与自己显卡匹配
conda create -n textgen python=3.10.9
conda init
conda activate textgen
pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu121/torch_stable.html
cu121表示对应显卡版本12,可以从官网查看,这个很关键
pip install -r requirements.txt
python server.py --model chinese-alpaca-2-7b --chat
9. 设置模型参数
‘conda’ 不是内部或外部命令,也不是可运行的程序 或批处理文件。
没有安装conda导致,且需要配置环境变量
版本太高
Channels: - defaults Platform: win-64 Collecting package metadata (repodata.json): done Solving environment: failed PackagesNotFoundError: The following packages are not available from current channels: - python=3.12.1* Current channels: - defaults To search for alternate channels that may provide the conda package you're looking for, navigate to https://anaconda.org and use the search bar at the top of the page.
这个错误是因为在当前Conda默认的渠道(
defaults)中找不到名为
python且版本为
3.12.1 的包。这可能是因为3.12.1版本的Python还没有被添加到默认的Conda渠道中。
conda需要先初始化
User
F:\AI\text-generation-webui-main>conda activate textgen
CondaError: Run 'conda init' before 'conda activate'
F:\AI\text-generation-webui-main>conda activate textgen
CondaError: Run 'conda init' before 'conda activate'
执行 conda init命令
User F:\AI\text-generation-webui-main>conda init no change D:\ProgramData\miniconda3\Scripts\conda.exe no change D:\ProgramData\miniconda3\Scripts\conda-env.exe no change D:\ProgramData\miniconda3\Scripts\conda-script.py no change D:\ProgramData\miniconda3\Scripts\conda-env-script.py no change D:\ProgramData\miniconda3\condabin\conda.bat no change D:\ProgramData\miniconda3\Library\bin\conda.bat no change D:\ProgramData\miniconda3\condabin\_conda_activate.bat no change D:\ProgramData\miniconda3\condabin\rename_tmp.bat no change D:\ProgramData\miniconda3\condabin\conda_auto_activate.bat no change D:\ProgramData\miniconda3\condabin\conda_hook.bat no change D:\ProgramData\miniconda3\Scripts\activate.bat no change D:\ProgramData\miniconda3\condabin\activate.bat no change D:\ProgramData\miniconda3\condabin\deactivate.bat modified D:\ProgramData\miniconda3\Scripts\activate modified D:\ProgramData\miniconda3\Scripts\deactivate modified D:\ProgramData\miniconda3\etc\profile.d\conda.sh modified D:\ProgramData\miniconda3\etc\fish\conf.d\conda.fish no change D:\ProgramData\miniconda3\shell\condabin\Conda.psm1 modified D:\ProgramData\miniconda3\shell\condabin\conda-hook.ps1 no change D:\ProgramData\miniconda3\Lib\site-packages\xontrib\conda.xsh modified D:\ProgramData\miniconda3\etc\profile.d\conda.csh modified C:\Users\li132\Documents\WindowsPowerShell\profile.ps1 modified HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun ==> For changes to take effect, close and re-open your current shell. <== F:\AI\text-generation-webui-main>conda activate textgen CondaError: Run 'conda init' before 'conda activate' F:\AI\text-generation-webui-main>
请按照指示关闭当前的命令提示符或PowerShell窗口。然后重新打开一个新窗口,并尝试再次激活你的Conda环境:
Building wheels for collected packages: hqq, rouge-score, ffmpy, sqlitedict ERROR: Error [WinError 267] 目录名称无效。 while executing command python setup.py bdist_wheel Building wheel for hqq (setup.py) ... error ERROR: Failed building wheel for hqq Running setup.py clean for hqq ERROR: Error [WinError 267] 目录名称无效。 while executing command python setup.py clean ERROR: Failed cleaning build dir for hqq ERROR: Error [WinError 267] 目录名称无效。 while executing command python setup.py bdist_wheel Building wheel for rouge-score (setup.py) ... error ERROR: Failed building wheel for rouge-score Running setup.py clean for rouge-score ERROR: Error [WinError 267] 目录名称无效。 while executing command python setup.py clean ERROR: Failed cleaning build dir for rouge-score Building wheel for ffmpy (setup.py) ... done Created wheel for ffmpy: filename=UNKNOWN-0.0.0-py3-none-any.whl size=929 sha256=c39123b3685649e5c5b9257c5604bff8e38ba7fd93f903cde779483dde2b9e3c Stored in directory: c:\users\li132\appdata\local\pip\cache\wheels\01\a6\d1\1c0828c304a4283b2c1639a09ad86f83d7c487ef34c6b4a1bf WARNING: Built wheel for ffmpy is invalid: Wheel has unexpected file name: expected 'ffmpy', got 'UNKNOWN' ERROR: Error [WinError 267] 目录名称无效。 while executing command python setup.py bdist_wheel Building wheel for sqlitedict (setup.py) ... error ERROR: Failed building wheel for sqlitedict Running setup.py clean for sqlitedict ERROR: Error [WinError 267] 目录名称无效。 while executing command python setup.py clean ERROR: Failed cleaning build dir for sqlitedict Failed to build hqq rouge-score ffmpy sqlitedict ERROR: Could not build wheels for hqq, rouge-score, ffmpy, sqlitedict, which is required to install pyproject.toml-based projects
不要用cmd ,用Powershell
拼写正确即可
运行 python -c "impot torch;print(torch.cuda.is_available()) 判断返回值,false表示不支持,true表示支持,卸载重装"
之前看其他博主安装时通过start_windows.bat 安装,网页启动后加载模型然后报 ExLlama这个模块找不到的错误,于是乎看到国内的Gitee上的项目说exllama需要安装微软的编译器环境及英伟达的CUDA驱动(这个驱动安装包3G),按照操作走流程。最终还是找不到这个模块,于是放弃了,采用conda的方式进行安装,安装的时候CUDA驱动一直没有删除,直到看到这里
通过mvcc -version 命令查看显卡CUDA驱动版本11.8,下载了对应的torch版本对应的为11.8
该版本的torch显示支持显卡驱动了,启动报错显示找不到模块。
说明11.8的torch与CUDA 11.8 不匹配。卸载了11.8的torch和删除了CUDA驱动,后重写安装。torch用官网的12.1 ,驱动下载最新的12(600MB)再次启动才成功。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。