Skip to content

whisper: Improve support for local custom Whisper models #3988

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

DT-art1
Copy link

@DT-art1 DT-art1 commented Apr 18, 2025

Proposed change

This updates the 'whisper' add-on to clarify how to configure and use a local custom Whisper model.

Changes:

  • Added configuration mapping to access local models.
  • Updated documentation about custom_model usage.

Summary by CodeRabbit

  • Documentation

    • Enhanced instructions for using a local custom Whisper model, specifying directory paths and configuration steps.
    • Added new changelog entries highlighting recent documentation and configuration updates.
  • Chores

    • Updated configuration to enable access to local models by adding a new mapping section.

- Updated documentation about `custom_model` usage.
Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DT-art1

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant home-assistant bot marked this pull request as draft April 18, 2025 16:13
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@DT-art1 DT-art1 marked this pull request as ready for review April 18, 2025 16:22
Copy link
Contributor

coderabbitai bot commented Apr 18, 2025

📝 Walkthrough
## Walkthrough

The changes introduce updates to the Whisper add-on for Home Assistant, focusing on enabling and documenting support for local custom Whisper models. The changelog now includes a "2.5.0" section detailing these updates. The documentation has been expanded to provide clear instructions for users on how to use local custom models by copying them into a specific directory and referencing them correctly in the configuration. Additionally, the configuration file has been modified to include a new mapping that allows read-write access to the add-on's configuration directory.

## Changes

| File(s)                | Change Summary                                                                                              |
|------------------------|------------------------------------------------------------------------------------------------------------|
| whisper/CHANGELOG.md    | Added a "2.5.0" section with entries about local model configuration mapping and documentation updates.    |
| whisper/DOCS.md         | Expanded documentation for the `custom_model` option, including instructions for using local custom models. |
| whisper/config.yaml     | Updated version to 2.5.0 and added a `map` section to enable read-write access to the add-on config directory.|

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant HomeAssistant
    participant WhisperAddon

    User->>HomeAssistant: Copy custom Whisper model to /addon_configs/core_whisper/<model-dir>
    User->>HomeAssistant: Update config with custom_model: /config/<model-dir>
    HomeAssistant->>WhisperAddon: Start add-on with updated config
    WhisperAddon->>WhisperAddon: Access custom model from /config/<model-dir>
    WhisperAddon-->>User: Use local custom Whisper model for operations

</details>

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 205a255a51f7240e3783ff72ec0f1f354c50adf6 and c3f58447a1ce66009c5a83b761408dee2cad18ac.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `whisper/CHANGELOG.md` (1 hunks)
* `whisper/config.yaml` (2 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary>

* whisper/config.yaml
* whisper/CHANGELOG.md

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAdwREbkouAElmXnwpe2xubnwKUIAzfMgvfAY0XwZsRAJmSAB1BKS+ZkUSL0RoyFi0ZAcBZnUaejkw2A8aykgAEWgwZ1wARnRkW0gMRwFpgGYATgAOA/4sXAnIAAkWDwBBREQkXExQtFpaMHwMZH88h4IXDQwc7MbRYbjYCi/Dz4QrjVDrVAESBkWCYBgeM4eADk8SQLSx6DeHywYwyEngtHgGCIjEizmmVNqFGwYngn2QmHo8HSFEyUSYGEK8CIEOobKw+G44nZkGKfBqVJpZQqVRqdUazWmbSUnQ0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abbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=home-assistant/addons&utm_content=3988):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` or `@coderabbitai title` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
whisper/DOCS.md (1)

70-74: Normalize inline code formatting
The path snippet is wrapped in both quotes and backticks. Remove the extra quotes so the code renders cleanly:

- "`/config/<your-model-dir>`". For a local model, the path must start with `/config/`, as this is how the add-on accesses your Home Assistant configuration directory through the container's mounted volume.
+ `/config/<your-model-dir>`. For a local model, the path must start with `/config/`, as this is how the add-on accesses your Home Assistant configuration directory through the container's mounted volume.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a97ef71 and 9fcb46c.

📒 Files selected for processing (3)
  • whisper/CHANGELOG.md (1 hunks)
  • whisper/DOCS.md (1 hunks)
  • whisper/config.yaml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
`*/**(html|markdown|md)`: - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure t...

*/**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'
  • whisper/CHANGELOG.md
  • whisper/config.yaml
  • whisper/DOCS.md
`*/**(html|markdown|md)`: - Use bold to mark UI strings. - If "" are used to mark UI strings, replace them by bold.

*/**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.
  • whisper/CHANGELOG.md
  • whisper/config.yaml
  • whisper/DOCS.md
`*/**(html|markdown|md)`: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"

*/**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"

  • whisper/CHANGELOG.md
  • whisper/config.yaml
  • whisper/DOCS.md
`*/**(html|markdown|md)`: - Use sentence-style capitalization also in headings.

*/**(html|markdown|md): - Use sentence-style capitalization also in headings.

  • whisper/CHANGELOG.md
  • whisper/config.yaml
  • whisper/DOCS.md
`*/**(html|markdown|md)`: do not comment on HTML used for icons

*/**(html|markdown|md): do not comment on HTML used for icons

  • whisper/CHANGELOG.md
  • whisper/config.yaml
  • whisper/DOCS.md
`*/**(html|markdown|md)`: Avoid flagging inline HTML for embedding videos in future reviews for this repository.

*/**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.

  • whisper/CHANGELOG.md
  • whisper/config.yaml
  • whisper/DOCS.md
🔇 Additional comments (2)
whisper/config.yaml (1)

15-17: Add mapping for local‑model support
The new map entry with type: addon_config and read_only: false correctly exposes /config for custom Whisper models. Indentation and placement under the top‑level keys align with the add‑on manifest schema.

whisper/CHANGELOG.md (1)

3-7: Document Unreleased changes
The ## [Unreleased] section and its bullet entries accurately reflect the addition of the local‑model mapping and the documentation update for custom_model. The format and placement at the top of the changelog match existing conventions.

@agners agners changed the title Improve support for local custom Whisper models. whisper: Improve support for local custom Whisper models Apr 22, 2025
@home-assistant home-assistant bot marked this pull request as draft April 22, 2025 13:04
@DT-art1 DT-art1 marked this pull request as ready for review April 22, 2025 16:19
@home-assistant home-assistant bot requested a review from agners April 22, 2025 16:19
@synesthesiam
Copy link
Contributor

@DT-art1 The backup exclude rule is models*. I think we should advise people to put their custom models in a models sub-directory so they aren't included in the backup. What do you think?

@frenck frenck marked this pull request as draft April 24, 2025 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants