Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from dingo.exec import Executor
|
|
5 |
from dingo.io import InputArgs
|
6 |
|
7 |
|
8 |
-
def dingo_demo(input_path, data_format, column_content, rule_list, prompt_list, key, api_url):
|
9 |
if not input_path:
|
10 |
return 'ValueError: input_path can not be empty, please input.'
|
11 |
if not data_format:
|
@@ -27,6 +27,7 @@ def dingo_demo(input_path, data_format, column_content, rule_list, prompt_list,
|
|
27 |
{
|
28 |
"detect_text_quality_detail":
|
29 |
{
|
|
|
30 |
"key": key,
|
31 |
"api_url": api_url,
|
32 |
}
|
@@ -55,8 +56,9 @@ if __name__ == '__main__':
|
|
55 |
column_content = gr.Textbox(value="content", placeholder="please input column name of content in dataset", label="column_content")
|
56 |
rule_list = gr.CheckboxGroup(choices=rule_options, label="rule_list")
|
57 |
prompt_list = gr.CheckboxGroup(choices=prompt_options, label="prompt_list")
|
58 |
-
|
59 |
-
|
|
|
60 |
with gr.Row():
|
61 |
submit_single = gr.Button(value="Submit", interactive=True, variant="primary")
|
62 |
with gr.Column():
|
@@ -65,7 +67,7 @@ if __name__ == '__main__':
|
|
65 |
|
66 |
submit_single.click(
|
67 |
fn=dingo_demo,
|
68 |
-
inputs=[input_path, data_format, column_content, rule_list, prompt_list, key, api_url],
|
69 |
outputs=output
|
70 |
)
|
71 |
|
|
|
5 |
from dingo.io import InputArgs
|
6 |
|
7 |
|
8 |
+
def dingo_demo(input_path, data_format, column_content, rule_list, prompt_list, model, key, api_url):
|
9 |
if not input_path:
|
10 |
return 'ValueError: input_path can not be empty, please input.'
|
11 |
if not data_format:
|
|
|
27 |
{
|
28 |
"detect_text_quality_detail":
|
29 |
{
|
30 |
+
"model": model,
|
31 |
"key": key,
|
32 |
"api_url": api_url,
|
33 |
}
|
|
|
56 |
column_content = gr.Textbox(value="content", placeholder="please input column name of content in dataset", label="column_content")
|
57 |
rule_list = gr.CheckboxGroup(choices=rule_options, label="rule_list")
|
58 |
prompt_list = gr.CheckboxGroup(choices=prompt_options, label="prompt_list")
|
59 |
+
model = gr.Textbox(placeholder="If want to use llm, please input model, such as: deepseek-chat", label="model")
|
60 |
+
key = gr.Textbox(placeholder="If want to use llm, please input key, such as: 123456789012345678901234567890xx", label="key")
|
61 |
+
api_url = gr.Textbox(placeholder="If want to use llm, please input api_url, such as: https://api.deepseek.com/v1", label="api_url")
|
62 |
with gr.Row():
|
63 |
submit_single = gr.Button(value="Submit", interactive=True, variant="primary")
|
64 |
with gr.Column():
|
|
|
67 |
|
68 |
submit_single.click(
|
69 |
fn=dingo_demo,
|
70 |
+
inputs=[input_path, data_format, column_content, rule_list, prompt_list, model, key, api_url],
|
71 |
outputs=output
|
72 |
)
|
73 |
|