feat: 支持macOS平台WhisperCpp的GPU加速#910
Merged
WEIFENG2333 merged 1 commit intoWEIFENG2333:masterfrom Dec 11, 2025
Merged
Conversation
Contributor
A1nair
commented
Dec 10, 2025
- 在 whisper_cpp.py 中增加了对 macOS 的检测
- 在 whisper_cpp.py 中增加了对 macOS 的检测
There was a problem hiding this comment.
Pull request overview
This PR enables GPU acceleration support for WhisperCpp on macOS by conditionally applying the --no-gpu flag based on the platform.
Key Changes:
- Added
sysmodule import for platform detection - Modified
_build_commandto only add--no-gpuflag on non-macOS platforms (Windows/Linux)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+100
to
+101
| if sys.platform != "darwin": | ||
| whisper_params.append("--no-gpu") |
There was a problem hiding this comment.
The codebase already has a platform detection utility function is_macos() in app/core/utils/platform_utils.py that uses platform.system() == "Darwin". For consistency with the rest of the codebase, consider using that existing function instead of sys.platform != "darwin".
Suggested change:
if not is_macos():
whisper_params.append("--no-gpu")And add the import at the top:
from ..utils.platform_utils import is_macos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.