Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions app/components/FasterWhisperSettingWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,11 +574,12 @@ def _on_model_download_finished():
for enum_val in available:
combo.addItem(enum_val.value, userData=enum_val)

# 恢复选择
if current_value in available:
combo.setCurrentText(current_value.value)
elif combo.count() > 0:
combo.setCurrentIndex(0)
# 自动选择刚下载的模型
downloaded_model_value = model["value"]
for enum_val in available:
if enum_val.value == downloaded_model_value:
Comment on lines +579 to +580
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.
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


InfoBar.success(
self.tr("下载成功"),
Expand Down
Loading