Fix RAG inference

This commit is contained in:
2025-08-07 15:38:01 -05:00
parent 4327e1c581
commit e504407190
9 changed files with 222 additions and 31 deletions
+21 -9
View File
@@ -16,9 +16,7 @@ jobs:
runs-on: Windows
# *** KEY CHANGE ***
# Changed the shell from 'pwsh' to 'powershell' to use the default
# Windows PowerShell, which should be available on your runner.
# Set the default shell to PowerShell, which is native to your Windows runner.
defaults:
run:
shell: powershell
@@ -41,24 +39,38 @@ jobs:
if (-not (Test-Path -Path ".venv")) {
python -m venv .venv
}
# The activation command is different for PowerShell
.\.venv\Scripts\Activate.ps1
# Step 4: Install or update dependencies
- name: Install dependencies
run: |
# The venv is now active for this shell session, so we can call pip directly.
pip install --upgrade pip
pip install -r requirements.txt
# Step 5: Run the indexing script within the virtual environment
# Step 5: *** NEW - GPU Diagnostics ***
# This step will help us see if the runner can access the GPU and CUDA.
- name: Check GPU and CUDA status
run: |
echo "--- Checking for nvidia-smi ---"
# The '|| $true' part ensures the workflow doesn't fail if the command isn't found
nvidia-smi || $true
echo "--- Checking PyTorch CUDA availability ---"
# This command will explicitly tell us if PyTorch can see the GPU.
python -c "import torch; print(f'PyTorch version: {torch.__version__}'); print(f'CUDA available: {torch.cuda.is_available()}'); print(f'CUDA version: {torch.version.cuda}'); print(f'Device count: {torch.cuda.device_count()}')"
# Step 6: Run the indexing script within the virtual environment
- name: Run indexing script
run: |
# Call python directly, as the correct one is now on the PATH from the activated venv.
python create_index.py
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Optional: Specify the working directory if your bot lives in a subfolder
# working-directory: ./path/to/your/bot
# Step 7: Upload the database as an artifact
- name: Upload database artifact
uses: actions/upload-artifact@v4
with:
name: chroma_db_artifact
path: ./chroma_db