Skip to content

Conversation

@WEIFENG2333
Copy link
Owner

@WEIFENG2333 WEIFENG2333 commented Jan 11, 2026

Summary

修复 #939@philpw99 提到的 bug:下载模型后设定会变成 tiny。

问题原因:下载完成后代码尝试恢复之前的选择,如果失败就默认选第一个(tiny)。

修复:下载完成后自动选择刚下载的模型。

Test plan

  • 下载一个模型(如 large-v2),确认下载完成后自动选择该模型

🤖 Generated with Claude Code


Note

Ensures the settings select the newly downloaded Faster Whisper model instead of reverting to a default.

  • After model download, rebuilds model_card.comboBox and sets the current selection to the downloaded model via its value
  • Removes the prior "restore previous selection or select first (tiny)" fallback to prevent unintended tiny selection
  • Progress and success notifications remain unchanged

Written by Cursor Bugbot for commit a79ac9c. This will update automatically on new commits. Configure here.

Previously, after downloading a model, the selection would revert to
the first available model (usually tiny). Now it automatically selects
the just-downloaded model.

Fixes #939

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copilot AI review requested due to automatic review settings January 11, 2026 09:23
@claude
Copy link

claude bot commented Jan 11, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on January 24

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

for enum_val in available:
if enum_val.value == downloaded_model_value:
combo.setCurrentText(enum_val.value)
break
Copy link

Choose a reason for hiding this comment

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

Wrong field compared, downloaded model never auto-selected

High Severity

The comparison enum_val.value == downloaded_model_value will never match because model["value"] contains strings like "faster-whisper-large-v2" while FasterWhisperModelEnum values are "large-v2". The code uses model["value"] but it needs to use model["label"].lower() to get the matching format. As a result, the downloaded model is never auto-selected, defeating the entire purpose of this fix.

Fix in Cursor Fix in Web

Copy link

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 aims to fix a bug where after downloading a model, the selection would incorrectly default to "tiny" instead of automatically selecting the newly downloaded model.

Changes:

  • Modified the _on_model_download_finished callback to automatically select the downloaded model instead of trying to restore the previous selection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +579 to +580
for enum_val in available:
if enum_val.value == downloaded_model_value:
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The downloaded model value will never match the enum values. The model["value"] contains values like "faster-whisper-tiny", "faster-whisper-large-v2", etc., but FasterWhisperModelEnum enum values are "tiny", "large-v2", etc. (without the "faster-whisper-" prefix). The comparison enum_val.value == downloaded_model_value will always be false, so the newly downloaded model will never be selected.

To fix this, you need to extract the model name by removing the "faster-whisper-" prefix from the downloaded model value before comparing, or use the existing model_map logic that's already defined at lines 562-564 to properly map between the two formats.

Suggested change
for enum_val in available:
if enum_val.value == downloaded_model_value:
# 将下载的模型值规范化为枚举使用的形式(去掉前缀 "faster-whisper-")
downloaded_model_name = downloaded_model_value
prefix = "faster-whisper-"
if downloaded_model_name.startswith(prefix):
downloaded_model_name = downloaded_model_name[len(prefix) :]
for enum_val in available:
if enum_val.value == downloaded_model_name:

Copilot uses AI. Check for mistakes.
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.

2 participants