Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: STT model params add when create

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 22, 2025

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 Sep 22, 2025

[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

:disabled="!['TTS', 'LLM', 'IMAGE', 'TTI', 'TTV', 'ITV','STT'].includes(base_form_data.model_type)"
>
<AppIcon iconName="app-add-outlined" class="mr-4"/> {{ $t('common.add') }}
</el-button>
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 you provided is generally clean and well-formed, but there are a few small improvements that could be made for clarity and efficiency:

Improvements

  1. Consistent Conditional Checks: Ensure consistency in how conditionals are checked. Here, it's good to use the includes method consistently.

  2. Remove Unnecessary Disables: If an action should always be enabled (like adding), it might not need to be disabled under certain conditions.

Here's the updated code with these considerations:

<template>
  <div v-if="base_form_data.model_type === 'RERANKER'">
    <!-- Reranker specific content -->
  </div>
  <el-empty v-else-if="['EMBEDDING','STT'].some(type => type === base_form_data.model_type)">
    :description="$t('views.model.tip.emptyMessage2')"
  </el-empty>

  <template v-else>
    <div v-if="hasAddActionAvailable">{{ $t('common.add') }}</div>
    <div v-else>-- Disabled --</div>
  </template>
</template>

<script>
export default {
  data() {
    return {
      hasAddActionAvailable: ['TTS', 'LLM', 'IMAGE', 'TTI', 'TTV', 'ITV','STT'].includes(this.base_form_data.model_type)
    };
  }
};
</script>

Key Changes

  • Single Condition Check with Includes: Used .some() method instead of multiple || checks to determine if base_form_data.model_type is one of the values related to empty messages (RERANKER, 'EMBEDDING', or 'STT').

  • Computed Property: Introduced a computed property hasAddActionAvailable to simplify disabling logic by directly checking against a predetermined list.

This approach maintains readability while optimizing the conditional checking process.

@zhanweizhang7 zhanweizhang7 merged commit 67a82dc into v2 Sep 22, 2025
4 of 5 checks passed
@zhanweizhang7 zhanweizhang7 deleted the pr@v2@fix_stt_params branch September 22, 2025 09:19
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.

3 participants