Skip to content

Commit

Permalink
watchOS example & downloading improvements (argmaxinc#20)
Browse files Browse the repository at this point in the history
* Remove xcpretty from setup script, only needed for CI

* Add WatchOS example app and bugfix for downloading

- Breaking change: `load` has been renamed to `download` for clarity

- modelFolder is now an optional

- New init parameter to allow downloading if modelFolder is nil (default true)
  • Loading branch information
ZachNagengast authored Feb 14, 2024
1 parent fed90c7 commit 34e8985
Show file tree
Hide file tree
Showing 23 changed files with 1,075 additions and 449 deletions.
53 changes: 31 additions & 22 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,46 @@ on:
workflow_dispatch:

jobs:
cache-models:
runs-on: macos-14

steps:
- uses: actions/checkout@v4
- name: Setup environment
run: make setup
- name: Cache Models
uses: actions/cache@v4
with:
path: Models
key: ${{ runner.os }}-models
- name: Download and cache models
run: make download-model MODEL=tiny

build-and-test:
runs-on: macos-14
needs: cache-models
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.2'
- name: Setup environment
run: make setup
- name: Cache Models
- name: Setup Cache
id: model-cache
uses: actions/cache@v4
with:
path: Models
key: ${{ runner.os }}-models
- name: Build
run: xcodebuild clean build-for-testing -scheme whisperkit-Package -destination 'platform=macOS' | xcpretty
- name: Run tests
- name: Download Models
if: steps.model-cache.outputs.cache-hit != 'true'
run: make download-model MODEL=tiny
- name: Install and discover destinations
run: |
set -o pipefail
xcodebuild -downloadAllPlatforms
echo "Destinations for testing:"
xcodebuild test-without-building -only-testing WhisperKitTests/UnitTests -scheme whisperkit-Package -showdestinations
xcodebuild test-without-building -only-testing WhisperKitTests/UnitTests -scheme whisperkit-Package -destination "platform=macOS,arch=arm64" | xcpretty
- name: Build and Test - macOS
run: |
set -o pipefail
xcodebuild clean build-for-testing -scheme whisperkit-Package -destination generic/platform=macOS | xcpretty
xcodebuild test -only-testing WhisperKitTests/UnitTests -scheme whisperkit-Package -destination "platform=macOS,arch=arm64" | xcpretty
- name: Build and Test - iOS
run: |
set -o pipefail
xcodebuild clean build-for-testing -scheme whisperkit-Package -destination generic/platform=iOS | xcpretty
xcodebuild test -only-testing WhisperKitTests/UnitTests -scheme whisperkit-Package -destination "platform=iOS Simulator,OS=17.2,name=iPhone 15" | xcpretty
- name: Build and Test - watchOS
run: |
set -o pipefail
xcodebuild clean build-for-testing -scheme whisperkit-Package -destination generic/platform=watchOS | xcpretty
xcodebuild test -only-testing WhisperKitTests/UnitTests -scheme whisperkit-Package -destination "platform=watchOS Simulator,OS=10.2,name=Apple Watch Ultra 2 (49mm)" | xcpretty
- name: Build and Test - visionOS
run: |
set -o pipefail
xcodebuild clean build-for-testing -scheme whisperkit-Package -destination generic/platform=visionOS | xcpretty
xcodebuild test -only-testing WhisperKitTests/UnitTests -scheme whisperkit-Package -destination "platform=visionOS Simulator,name=Apple Vision Pro" | xcpretty
16 changes: 15 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,57 @@
# Contributing to WhisperKit

## Overview

We welcome and encourage contributions to WhisperKit! Whether you're fixing bugs, improving documentation, or adding new features from the roadmap, your help is appreciated. This guide will help you get started with contributing to WhisperKit.

## Getting Started

1. **Fork the Repository**: Start by [forking](https://github.com/argmaxinc/WhisperKit/fork) the WhisperKit repository on GitHub to your personal account.

2. **Clone Your Fork**: Clone your fork to your local machine to start making changes.

```bash
git clone https://github.com/[your-username]/whisperkit.git
cd whisperkit
```

## Setting Up Your Development Environment

1. **Install Dependencies**: Use the provided `Makefile` to set up your environment. Run `make setup` to install necessary dependencies.

```bash
make setup
```

2. **Download Models**: Run `make download-models` to download the required models to run and test locally.

```bash
make download-models
make download-model MODEL=tiny
```

## Making Changes

1. **Make Your Changes**: Implement your changes, add new features, or fix bugs. Ensure you adhere to the existing coding style. If you're adding new features, make sure to update or add any documentation or tests as needed.

2. **Build and Test**: You can use the `Makefile` to build and test your changes. Run `make build` to build WhisperKit and `make test` to run tests.

```bash
make build
make test
```

You can also run and test directly from Xcode. We've provided an example app that contains various use cases, just open the `Examples/WhisperAX/WhisperAX.xcodeproj` file in Xcode and run the app.

## Submitting Your Changes

1. **Commit Your Changes**: Once you're satisfied with your changes, commit them with a clear and concise commit message.

```bash
git commit -am "Add a new feature"
```

2. **Push to Your Fork**: Push your changes to your fork on GitHub.

```bash
git push origin my-branch
```
Expand All @@ -49,12 +61,14 @@ We welcome and encourage contributions to WhisperKit! Whether you're fixing bugs
4. **Code Review**: Wait for the maintainers to review your pull request. Be responsive to feedback and make any necessary changes.

## Guidelines

- **Code Style**: Follow the existing code style in the project.
- **Commit Messages**: Write meaningful commit messages that clearly describe the changes.
- **Documentation**: Update documentation if you're adding new features or making changes that affect how users interact with WhisperKit.
- **Tests**: Add or update tests for new features or bug fixes.

## Final Steps

After your pull request has been reviewed and approved, a maintainer will merge it into the main branch. Congratulations, you've successfully contributed to WhisperKit!

Thank you for making WhisperKit better for everyone! ❤️‍🔥
Loading

0 comments on commit 34e8985

Please sign in to comment.