privateGPT のインストールと動作確認(大規模言語モデルと対話型AI)(Build Tools, Python を使用)(Windows 上)
privateGPT のインストールと動作確認を行う.
【目次】
【関連する外部ページ】
公式の GitHub のページ:https://github.com/imartinez/privateGPT
前準備
Python のインストール(Windows上)
注:既にPython(バージョン3.12を推奨)がインストール済みの場合は,この手順は不要である.
winget(Windowsパッケージマネージャー)を使用してインストールを行う
- Windowsで,管理者権限でコマンドプロンプトを起動(手順:Windowsキーまたはスタートメニュー >
cmd
と入力 > 右クリック > 「管理者として実行」)。 - winget(Windowsパッケージマネージャー)が利用可能か確認する:
winget --version
- Pythonのインストール(下のコマンドにより Python 3.12 がインストールされる).
reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f REM Python をシステム領域にインストール winget install --scope machine --id Python.Python.3.12 -e --silent REM Python のパス set "INSTALL_PATH=C:\Program Files\Python312" echo "%PATH%" | find /i "%INSTALL_PATH%" >nul if errorlevel 1 setx PATH "%PATH%;%INSTALL_PATH%" /M >nul echo "%PATH%" | find /i "%INSTALL_PATH%\Scripts" >nul if errorlevel 1 setx PATH "%PATH%;%INSTALL_PATH%\Scripts" /M >nul
- Python詳細ガイド:Pythonまとめ »
【関連する外部サイト】
【サイト内の関連ページ】
Visual Studio 2022 Build Toolsとランタイムのインストール
管理者権限でコマンドプロンプトを起動(手順:Windowsキーまたはスタートメニュー > cmd と入力 > 右クリック > 「管理者として実行」)し、以下を実行する。管理者権限は、wingetの--scope machineオプションでシステム全体にソフトウェアをインストールするために必要である。
REM Visual Studio 2022 Build Toolsとランタイムのインストール
winget install --scope machine Microsoft.VisualStudio.2022.BuildTools Microsoft.VCRedist.2015+.x64
set VS_INSTALLER="C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe"
set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
REM C++開発ワークロードのインストール
%VS_INSTALLER% modify --installPath %VS_PATH% ^
--add Microsoft.VisualStudio.Workload.VCTools ^
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
--add Microsoft.VisualStudio.Component.Windows11SDK.22621 ^
--includeRecommended --quiet --norestart
Git のインストール(Windows 上)
Gitは,バージョン管理システム.ソースコードの管理や複数人での共同に役立つ.
【サイト内の関連ページ】 Windows での Git のインストール: 別ページ »で説明
【関連する外部ページ】 Git の公式ページ: https://git-scm.com/
OpenCV のインストール(Windows 上)
OpenCV 4.10.0 のインストール,動作確認(Windows 上): 別ページ »で説明
privateGPT のインストール(Windows 上)
- Windows で,管理者権限でコマンドプロンプトを起動(手順:Windowsキーまたはスタートメニュー >
cmd
と入力 > 右クリック > 「管理者として実行」)。 - ソースコードのダウンロード,インストール,学習済みモデル ggml-gpt4all-j のダウンロード
次のコマンドを実行.
cd /d c:%HOMEPATH% rmdir /s /q privateGPT git clone https://github.com/imartinez/privateGPT.git cd privateGPT python -m pip install -r requirements.txt copy example.env .env mkdir models cd models curl -L -O https://gpt4all.io/models/ggml-gpt4all-j-v1.3-groovy.bin
- ingest.py の実行
cd /d c:%HOMEPATH%\privateGPT python ingest.py
privateGPT の動作確認(Windows 上)
次のコマンドを実行.
cd /d c:%HOMEPATH%\privateGPT
python privateGPT.py
プロンプトを入れ,しばらく待つ.プロンプトとして「Please explain about computer science for beginner.」を入れたときの実行結果は次の通り.
