Skip to content

feat: 支持macOS平台WhisperCpp的GPU加速#910

Merged
WEIFENG2333 merged 1 commit intoWEIFENG2333:masterfrom
A1nair:fix/macos-whispercpp-gpu
Dec 11, 2025
Merged

feat: 支持macOS平台WhisperCpp的GPU加速#910
WEIFENG2333 merged 1 commit intoWEIFENG2333:masterfrom
A1nair:fix/macos-whispercpp-gpu

Conversation

@A1nair
Copy link
Copy Markdown
Contributor

@A1nair A1nair commented Dec 10, 2025

  • 在 whisper_cpp.py 中增加了对 macOS 的检测

- 在 whisper_cpp.py 中增加了对 macOS 的检测
Copilot AI review requested due to automatic review settings December 10, 2025 15:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 sys module import for platform detection
  • Modified _build_command to only add --no-gpu flag 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")
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

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

Copilot uses AI. Check for mistakes.
@WEIFENG2333 WEIFENG2333 merged commit 11a6463 into WEIFENG2333:master Dec 11, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants