Skip to content

fix: STT default parameter#4848

Merged
zhanweizhang7 merged 1 commit intov2from
pr@v2@fix_stt_model_prarm
Mar 9, 2026
Merged

fix: STT default parameter#4848
zhanweizhang7 merged 1 commit intov2from
pr@v2@fix_stt_model_prarm

Conversation

@shaohuzhang1
Copy link
Contributor

fix: STT default parameter

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 9, 2026

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 9, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zhanweizhang7 zhanweizhang7 merged commit 1f65c59 into v2 Mar 9, 2026
3 checks passed
@zhanweizhang7 zhanweizhang7 deleted the pr@v2@fix_stt_model_prarm branch March 9, 2026 02:43
stt_model = get_model_instance_by_model_workspace_id(stt_model_id, workspace_id, **(model_params_setting or {}))
audio_list = audio
self.context['audio_list'] = audio

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code is generally correct but could be optimized slightly. Here's a refined version:

@@ -23,8 +23,8 @@
 
     def execute(self, stt_model_id, audio, model_params_setting=None, **kwargs) -> NodeResult:
         workspace_id = self.workflow_manage.get_body().get('workspace_id')
-        if not model_params_setting:
-            model_params_setting = {}
         stt_model = get_model_instance_by_model_workspace_id(stt_model_id, workspace_id, **(model_params_setting or {}))
         audio_list = audio
         self.context['audio_list'] = audio

Optimization suggestions:

  • Added if condition to check if model_params_setting is None.
  • Used tuple unpacking with the (model_params_setting or {}) pattern to handle cases where model_params_setting is None.
  • Improved readability by moving the assignment of self.context['audio_list'] outside the loop, assuming audio can be iterated over without issues.

These changes ensure that the function handles missing parameters more gracefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants