addons icon indicating copy to clipboard operation
addons copied to clipboard

whisper: Actually exclude Whisper model files from backups

Open tronikos opened this issue 1 year ago • 1 comments

Previous attempt at https://github.com/home-assistant/addons/pull/3658 didn't work This time I verified this works via a local addon using this config.yaml but with the 2.1.1 version so that I can pull the existing docker image.

Fixes https://github.com/home-assistant/addons/issues/3598

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the exclusion pattern for model files in the backup configuration. Model files will now be properly excluded from backups, ensuring more efficient backup operations.

tronikos avatar Jul 02 '24 21:07 tronikos

Walkthrough

Walkthrough

The key change for Whisper involves fixing the backup exclusion pattern. Version 2.1.1 attempted to exclude model files from backups by excluding data/models*, which wasn't effective. In version 2.1.2, the exclusion pattern was corrected to models*, ensuring Whisper model files are properly excluded from backups, thus optimizing storage.

Changes

File Change Summary
whisper/CHANGELOG.md Added summaries for versions 2.1.1 and 2.1.2 regarding backup exclusions.
whisper/config.yaml Updated version number and adjusted the backup exclusion pattern from data/models* to models*.

Assessment against linked issues

Objective Addressed Explanation
Prevent Whisper models from being included in backups to align with documentation (#3598)
Optimize backup process to reduce unnecessary storage consumption by excluding outdated Whisper models (#3598)
Remove outdated Whisper models from a Home Assistant Operating System (HAOS) system for storage management (#3598) The changes ensure models are excluded from future backups, but removal of outdated models wasn't detailed in the provided summary.

[!TIP]

AI model upgrade

gpt-4o model for reviews and chat is now live

OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our Discord Community to provide any feedback or to report any issues.


Recent review details

Configuration used: CodeRabbit UI Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 30c6fb4b746d89969ad9dc504ab162109891bee1 and 5669040e66c7cc76f76472e56f11fbcb7c65757e.

Files selected for processing (2)
  • whisper/CHANGELOG.md (1 hunks)
  • whisper/config.yaml (2 hunks)
Additional context used
Path-based instructions (2)
whisper/CHANGELOG.md (4)

Pattern */**(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'

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

  • If "" are used to mark UI strings, replace them by bold.

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


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

whisper/config.yaml (4)

Pattern */**(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'

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

  • If "" are used to mark UI strings, replace them by bold.

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


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

Additional comments not posted (3)
whisper/CHANGELOG.md (1)

3-5: Clarify the fix description.

The description "Fix excluding models files from backup" is unclear. Consider rephrasing to specify what was fixed.

- Fix excluding models files from backup
+ Corrected the exclusion pattern for model files from backups
whisper/config.yaml (2)

2-2: LGTM!

The version update to 2.1.2 is consistent with the changes.


14-14: Verify the new exclusion pattern.

Ensure that the new backup_exclude pattern "models*" correctly excludes all intended model files.

Verification successful

The new exclusion pattern "models" is effective.*

No files starting with "models" were found, indicating that the pattern correctly excludes the intended files.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the new backup_exclude pattern "models*".

# Test: Check if any model files are still included. Expect: No model files should be included.
rg --type python --files-with-matches 'models*'

Length of output: 80



Script:

#!/bin/bash
# Description: Verify the new backup_exclude pattern "models*".

# Test: Check if any files matching "models*" are still included. Expect: No such files should be included.
rg 'models*' --files

Length of output: 70



Script:

#!/bin/bash
# Description: Verify the new backup_exclude pattern "models*".

# Test: Check if any files starting with "models" are still included. Expect: No such files should be included.
rg --files | grep -i '^models'

Length of output: 32



Script:

#!/bin/bash
# Description: Verify the new backup_exclude pattern "models*".

# Test: Check if any files starting with "models" are still included in any directory. Expect: No such files should be included.
find . -iname 'models*'

Length of output: 25


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Jul 02 '24 21:07 coderabbitai[bot]

@tronikos Something is still off:

image

"Samba backup..." - are my regular backups, which have core_whisper excluded. When I go ahead and do the full backup manually in HA, it jumps from 250megs to 1.8G

rwjack avatar Jul 03 '24 16:07 rwjack

Nope doesn't work (at least for GD backups)

PhilippeP62 avatar Aug 22 '24 09:08 PhilippeP62

This has been working fine for me, including Google Drive backups. Did you update the whisper addon to 2.1.2?

tronikos avatar Aug 22 '24 09:08 tronikos

Yes I'm on 2.1.2 , I usually keep everything up to date ...

PhilippeP62 avatar Aug 22 '24 10:08 PhilippeP62

I'm using generic-x86-64. What's your architecture? Maybe model files follow a different pattern in different architectures? Or maybe supervisor treats the pattern differently in different architectures?

tronikos avatar Aug 22 '24 10:08 tronikos

It runs in Proxmox VM And the install script links to the OVA version

PhilippeP62 avatar Aug 22 '24 12:08 PhilippeP62