refactor(frontend): 重构数据集生成页面的变量命名逻辑
- 将 prompt_choices 变量重命名为 prompt_list,以更准确地反映其内容 - 更新相关代码中对这两个变量的引用,以保持一致性
This commit is contained in:
parent
d0aebd17fa
commit
6b87dcb58f
@ -23,11 +23,11 @@ def dataset_generate_page():
|
||||
with gr.Column():
|
||||
# 获取模板列表并设置初始值
|
||||
prompts = get_prompt_store().all()
|
||||
prompt_choices = [f"{p['id']} {p['name']}" for p in prompts]
|
||||
initial_prompt = prompt_choices[0] if prompt_choices else None
|
||||
prompt_list = [f"{p['id']} {p['name']}" for p in prompts]
|
||||
initial_prompt = prompt_list[0] if prompt_list else None
|
||||
|
||||
prompt_dropdown = gr.Dropdown(
|
||||
choices=prompt_choices,
|
||||
choices=prompt_list,
|
||||
value=initial_prompt, # 设置初始选中项
|
||||
label="选择模板",
|
||||
allow_custom_value=True,
|
||||
|
Loading…
x
Reference in New Issue
Block a user