Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PowerShell script for setup on Windows 11 #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,14 @@ Welcome to discuss with us and continuously improve the user experience of Compu

<img src="./assets/group_chat.jpg" alt="gradio_interface" width="30%">





### 5. Automate Setup on Windows 11 with PowerShell
To automate the installation of dependencies and setup on Windows 11, you can use the provided PowerShell script `setup.ps1`.

#### Steps to Run the PowerShell Script:
1. Open PowerShell as Administrator.
2. Navigate to the directory where you cloned the repository.
3. Run the following command:
```powershell
.\setup.ps1
```
This script will install Miniconda, set up a Conda environment, install Python dependencies from `dev-requirements.txt`, and start the interface.
38 changes: 38 additions & 0 deletions setup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# PowerShell script to automate the installation of dependencies and setup on Windows 11

# Function to check if a command exists
function Command-Exists {
param (
[string]$command
)
$commandPath = Get-Command $command -ErrorAction SilentlyContinue
return $commandPath -ne $null
}

# 1. Install Miniconda if not already installed
if (-not (Command-Exists 'conda')) {
Write-Output "Miniconda not found. Installing Miniconda..."
$minicondaInstaller = "Miniconda3-latest-Windows-x86_64.exe"
Invoke-WebRequest -Uri "https://repo.anaconda.com/miniconda/$minicondaInstaller" -OutFile $minicondaInstaller
Start-Process -Wait -FilePath .\$minicondaInstaller -ArgumentList "/InstallationType=JustMe", "/AddToPath=1", "/RegisterPython=1", "/S", "/D=$env:USERPROFILE\Miniconda3"
Remove-Item .\$minicondaInstaller
RefreshEnv
} else {
Write-Output "Miniconda is already installed."
}

# 2. Ensure the Anthropic API key is set in the environment or storage
if (-not $env:ANTHROPIC_API_KEY) {
Write-Output "Anthropic API key not found. Please set it in the environment or storage."
exit 1
}

# 3. Set up a Conda environment and install Python dependencies
Write-Output "Setting up Conda environment and installing Python dependencies..."
conda create -n computer_use_ootb python=3.11 -y
conda activate computer_use_ootb
pip install -r dev-requirements.txt

# 4. Start the interface
Write-Output "Starting the interface..."
python app.py