准备
下载安装指定版本的 python 和 cuda 驱动:
https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe
https://developer.download.nvidia.com/compute/cuda/12.5.1/local_installers/cuda_12.5.1_555.85_windows.exe
安装
从仓库下载源码(v1.9.6):
$ git clone https://github.com/argosopentech/argos-translate
把install.bat
复制到目录下,直接运行安装即可。
使用
argospm.bat -h
argos-translate.bat -f zh -t en "测试一下"
install.bat
@echo off
rem python_3.8.10/cuda_12.5.1
rem https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe
rem https://developer.download.nvidia.com/compute/cuda/12.5.1/local_installers/cuda_12.5.1_555.85_windows.exe
pip install virtualenv
virtualenv venv
SET PYTHONUTF8=1
SET ARGOS_DEVICE_TYPE=cuda
SET PIP=%~dp0venv\Scripts\pip.exe
SET PYTHON=%~dp0venv\Scripts\python.exe
%PYTHON% -m pip install --upgrade pip || goto XEND
rem %PIP% config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple || goto XEND
%PIP% install . || goto XEND
%PIP% install torch==2.3.1+cu121 -f https://download.pytorch.org/whl/torch_stable.html || goto XEND
%PYTHON% bin\argospm install translate-zh_en
%PIP% cache purge
goto XEND
:XEND
pause
argospm.bat
@echo off
SET PYTHONUTF8=1
SET ARGOS_DEVICE_TYPE=cuda
%~dp0venv\Scripts\python.exe %~dp0bin\argospm %*
argos-translate.bat
@echo off
SET PYTHONUTF8=1
SET ARGOS_DEVICE_TYPE=cuda
%~dp0venv\Scripts\python.exe %~dp0bin\argos-translate %*