Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Image generate model disable history mode #1841

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

shaohuzhang1
Copy link
Contributor

refactor: Image generate model disable history mode

Copy link

f2c-ci-robot bot commented Dec 16, 2024

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.

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/test-infra repository.

Copy link

f2c-ci-robot bot commented Dec 16, 2024

[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.

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


dialogue_type = serializers.CharField(required=True, error_messages=ErrMessage.char("对话存储类型"))
dialogue_type = serializers.CharField(required=False, default='NODE', error_messages=ErrMessage.char("对话存储类型"))

is_result = serializers.BooleanField(required=False, error_messages=ErrMessage.boolean('是否返回内容'))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

代码中存在一些小问题和建议:

  1. negative_prompt 的字段属性 allow_null=Trueallow_blank=True 实际上没有使用。可以考虑删除这些不必要的属性。

    修正: 从列表中的第三个元素开始移除这两个属性。

  2. 检查其他地方是否也有类似配置,避免重复设置相同的默认值或允许空格/空串的情况。

以下是修改后的代码示例:

class ImageGenerateNodeSerializer(serializers.Serializer):
    prompt = serializers.CharField(required=True, error_messages=ErrMessage.char("提示词(正向)"))

    
    negative_prompt = serializers.CharField(required=False, default='', error_messages=ErrMessage.char("提示词(负向)"), )
    # 多轮对话数量
    dialogue_number = serializers.IntegerField(required=True, error_messages=ErrMessage.integer("多轮对话数量"))
    
    dialogue_type = serializers.CharField(required=False, default='NODE', error_messages=ErrMessage.char("对话存储类型"))
    
    is_result = serializers.BooleanField(required=False, error_messages=ErrMessage.boolean('是否返回内容'))

请注意,在实际应用中可能还需要根据具体需求调整其他字段(如 default 值)的具体含义。

@@ -178,6 +180,7 @@
:step-strictly="true"
/>
</el-form-item>
-->
<el-form-item label="返回内容" @click.prevent>
<template #label>
<div class="flex align-center">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

代码的差异看起来有一些地方可能需要改进或优化:

  1. 占位符和描述

    • v-model="form_data.negative_prompt" 中,placeholder 属性是多余的,并且它应该放在 el-form-item 标签内部。
    • 在第一个 el-form-item 之外的部分,注释掉了一些内容。建议将这些评论保留或删除。
  2. 表单项排列

    • 表单内的组件没有明确的布局方式,可能需要通过 CSS 或框架提供的工具来更好地排版显示信息。

以下是修改后的示例代码片段:

- <template #label>
+ <div class="flex-between">

- </template>

- @click.prevent
+ <button>点击我</button>

请注意,具体的调整取决于你使用的前端框架(如 Vue.js)。以上只是一个基本模板的修改指南。如果还有其他问题,请提供更多详细信息,以便进一步协助。

@liuruibin liuruibin merged commit c816c95 into main Dec 16, 2024
4 checks passed
@liuruibin liuruibin deleted the pr@main@refactor_imaeg_mode_history branch December 16, 2024 07:43
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