Tuchuanhuhuhu commited on
Commit
286541b
·
1 Parent(s): 478872e

UI: 将文件 ID 显示出来并允许修改

Browse files
Files changed (1) hide show
  1. ChuanhuChatbot.py +5 -4
ChuanhuChatbot.py CHANGED
@@ -36,7 +36,6 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
36
  assert type(my_api_key)==str
37
  user_api_key = gr.State(my_api_key)
38
  current_model = gr.State(create_new_model)
39
- openai_ft_file_id = gr.State("")
40
 
41
  topic = gr.State(i18n("未命名对话历史记录"))
42
 
@@ -189,16 +188,18 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
189
  downloadFile = gr.File(interactive=True)
190
 
191
  with gr.Tab(label=i18n("训练")):
192
- with gr.Column(variant="panel"):
193
  dataset_preview_json = gr.JSON(label=i18n("数据集预览"), readonly=True)
194
  dataset_selection = gr.Files(label = i18n("选择数据集"), file_types=[".xlsx", ".jsonl"], file_count="single")
195
  upload_to_openai_btn = gr.Button(i18n("上传到OpenAI"), interactive=False)
196
 
197
- with gr.Column(variant="panel"):
 
198
  openai_ft_suffix = gr.Textbox(label=i18n("模型名称后缀"), value="", lines=1, placeholder=i18n("可选,用于区分不同的模型"))
199
  openai_train_epoch_slider = gr.Slider(label=i18n("训练轮数"), minimum=1, maximum=100, value=3, step=1, interactive=True)
200
  openai_start_train_btn = gr.Button(i18n("开始训练"))
201
- with gr.Column(variant="panel"):
 
202
  openai_train_status = gr.Markdown(label=i18n("训练状态"), value=i18n("未开始训练"))
203
  openai_status_refresh_btn = gr.Button(i18n("刷新状态"))
204
  openai_cancel_all_jobs_btn = gr.Button(i18n("取消所有任务"))
 
36
  assert type(my_api_key)==str
37
  user_api_key = gr.State(my_api_key)
38
  current_model = gr.State(create_new_model)
 
39
 
40
  topic = gr.State(i18n("未命名对话历史记录"))
41
 
 
188
  downloadFile = gr.File(interactive=True)
189
 
190
  with gr.Tab(label=i18n("训练")):
191
+ with gr.Column():
192
  dataset_preview_json = gr.JSON(label=i18n("数据集预览"), readonly=True)
193
  dataset_selection = gr.Files(label = i18n("选择数据集"), file_types=[".xlsx", ".jsonl"], file_count="single")
194
  upload_to_openai_btn = gr.Button(i18n("上传到OpenAI"), interactive=False)
195
 
196
+ with gr.Column():
197
+ openai_ft_file_id = gr.Textbox(label=i18n("文件ID"), value="", lines=1, placeholder=i18n("上传到 OpenAI 后自动填充"))
198
  openai_ft_suffix = gr.Textbox(label=i18n("模型名称后缀"), value="", lines=1, placeholder=i18n("可选,用于区分不同的模型"))
199
  openai_train_epoch_slider = gr.Slider(label=i18n("训练轮数"), minimum=1, maximum=100, value=3, step=1, interactive=True)
200
  openai_start_train_btn = gr.Button(i18n("开始训练"))
201
+
202
+ with gr.Column():
203
  openai_train_status = gr.Markdown(label=i18n("训练状态"), value=i18n("未开始训练"))
204
  openai_status_refresh_btn = gr.Button(i18n("刷新状态"))
205
  openai_cancel_all_jobs_btn = gr.Button(i18n("取消所有任务"))