dev_1030
Browse files
app.py
CHANGED
|
@@ -21,8 +21,8 @@ def dingo_demo(
|
|
| 21 |
):
|
| 22 |
if not data_format:
|
| 23 |
raise gr.Error('ValueError: data_format can not be empty, please input.')
|
| 24 |
-
if not column_content:
|
| 25 |
-
|
| 26 |
if not rule_list and not prompt_list:
|
| 27 |
raise gr.Error('ValueError: rule_list and prompt_list can not be empty at the same time.')
|
| 28 |
|
|
@@ -53,9 +53,7 @@ def dingo_demo(
|
|
| 53 |
"dataset": {
|
| 54 |
"source": dataset_source,
|
| 55 |
"format": data_format,
|
| 56 |
-
"field": {
|
| 57 |
-
"content": column_content
|
| 58 |
-
}
|
| 59 |
},
|
| 60 |
"executor": {
|
| 61 |
"rule_list": rule_list,
|
|
@@ -81,6 +79,8 @@ def dingo_demo(
|
|
| 81 |
input_data['dataset']['field']['id'] = column_id
|
| 82 |
if column_prompt:
|
| 83 |
input_data['dataset']['field']['prompt'] = column_prompt
|
|
|
|
|
|
|
| 84 |
if column_image:
|
| 85 |
input_data['dataset']['field']['image'] = column_image
|
| 86 |
|
|
@@ -292,7 +292,7 @@ if __name__ == '__main__':
|
|
| 292 |
)
|
| 293 |
|
| 294 |
data_format = gr.Dropdown(
|
| 295 |
-
["jsonl", "json", "plaintext", "listjson"],
|
| 296 |
label="data_format"
|
| 297 |
)
|
| 298 |
with gr.Row():
|
|
@@ -369,7 +369,7 @@ if __name__ == '__main__':
|
|
| 369 |
visible=False
|
| 370 |
)
|
| 371 |
column_content = gr.Textbox(
|
| 372 |
-
value="
|
| 373 |
placeholder="Column name of content in the input file. If exists multiple levels, use '.' separate",
|
| 374 |
label="column_content",
|
| 375 |
visible=False
|
|
@@ -438,4 +438,4 @@ if __name__ == '__main__':
|
|
| 438 |
)
|
| 439 |
|
| 440 |
# 启动界面
|
| 441 |
-
demo.launch()
|
|
|
|
| 21 |
):
|
| 22 |
if not data_format:
|
| 23 |
raise gr.Error('ValueError: data_format can not be empty, please input.')
|
| 24 |
+
# if not column_content:
|
| 25 |
+
# raise gr.Error('ValueError: column_content can not be empty, please input.')
|
| 26 |
if not rule_list and not prompt_list:
|
| 27 |
raise gr.Error('ValueError: rule_list and prompt_list can not be empty at the same time.')
|
| 28 |
|
|
|
|
| 53 |
"dataset": {
|
| 54 |
"source": dataset_source,
|
| 55 |
"format": data_format,
|
| 56 |
+
"field": {}
|
|
|
|
|
|
|
| 57 |
},
|
| 58 |
"executor": {
|
| 59 |
"rule_list": rule_list,
|
|
|
|
| 79 |
input_data['dataset']['field']['id'] = column_id
|
| 80 |
if column_prompt:
|
| 81 |
input_data['dataset']['field']['prompt'] = column_prompt
|
| 82 |
+
if column_content:
|
| 83 |
+
input_data['dataset']['field']['content'] = column_content
|
| 84 |
if column_image:
|
| 85 |
input_data['dataset']['field']['image'] = column_image
|
| 86 |
|
|
|
|
| 292 |
)
|
| 293 |
|
| 294 |
data_format = gr.Dropdown(
|
| 295 |
+
["jsonl", "json", "plaintext", "listjson","image"],
|
| 296 |
label="data_format"
|
| 297 |
)
|
| 298 |
with gr.Row():
|
|
|
|
| 369 |
visible=False
|
| 370 |
)
|
| 371 |
column_content = gr.Textbox(
|
| 372 |
+
value="",
|
| 373 |
placeholder="Column name of content in the input file. If exists multiple levels, use '.' separate",
|
| 374 |
label="column_content",
|
| 375 |
visible=False
|
|
|
|
| 438 |
)
|
| 439 |
|
| 440 |
# 启动界面
|
| 441 |
+
demo.launch(server_port=7861, share=True)
|