Spaces:
Runtime error
Runtime error
DSXiangLi
commited on
Commit
•
7f271de
1
Parent(s):
769e5d5
- app.py +12 -12
- self/__pycache__/generate.cpython-38.pyc +0 -0
app.py
CHANGED
@@ -9,7 +9,7 @@ from self.prompt import self_prompt
|
|
9 |
|
10 |
with gr.Blocks(title="Automatic Prompt Engineer", theme=gr.themes.Glass()) as demo:
|
11 |
gr.Markdown("# Automatic Prompt Engineer")
|
12 |
-
with gr.Row():
|
13 |
with gr.Column(scale=2):
|
14 |
gr.Markdown("## 第一步:输入参数")
|
15 |
with gr.Row():
|
@@ -24,11 +24,11 @@ with gr.Blocks(title="Automatic Prompt Engineer", theme=gr.themes.Glass()) as de
|
|
24 |
with gr.Column(scale=3):
|
25 |
gr.Markdown("## 第二步:加载数据(选任务或上传数据)")
|
26 |
with gr.Tab("选择数据"):
|
27 |
-
with gr.Row():
|
28 |
file = gr.File(label='上传txt文件,input[空格]output[换行]')
|
29 |
-
with gr.Row():
|
30 |
task = gr.Dropdown(label="Chosse Existing Task", choices=list(LoadFactory.keys()), value=None)
|
31 |
-
with gr.Row():
|
32 |
instance = gr.State()
|
33 |
load_button = gr.Button("Load Task")
|
34 |
load_flag = gr.Textbox()
|
@@ -40,7 +40,7 @@ with gr.Blocks(title="Automatic Prompt Engineer", theme=gr.themes.Glass()) as de
|
|
40 |
train_str = gr.Textbox(max_lines=100, lines=10, label="Data for prompt generation")
|
41 |
eval_str = gr.Textbox(max_lines=100, lines=10, label="Data for scoring")
|
42 |
|
43 |
-
with gr.Row():
|
44 |
with gr.Column(scale=2):
|
45 |
gr.Markdown("## 第三步: Run APE(可替换默认指令)")
|
46 |
gen_prompt = gr.Textbox(max_lines=100, lines=3, interative=True,
|
@@ -53,10 +53,10 @@ with gr.Blocks(title="Automatic Prompt Engineer", theme=gr.themes.Glass()) as de
|
|
53 |
placeholder=MyTemplate['test_prompt'],
|
54 |
value='', label="Prompt for Single Test")
|
55 |
|
56 |
-
with gr.Row():
|
57 |
cost = gr.Textbox(lines=1, value="", label="Estimated Cost ($)")
|
58 |
cost_button = gr.Button("Estimate Cost")
|
59 |
-
with gr.Row():
|
60 |
gen_button = gr.Button("Generate")
|
61 |
eval_button = gr.Button("Eval")
|
62 |
|
@@ -69,7 +69,7 @@ with gr.Blocks(title="Automatic Prompt Engineer", theme=gr.themes.Glass()) as de
|
|
69 |
|
70 |
with gr.Tab("指令单测"):
|
71 |
# Test the output of LLM using prompt
|
72 |
-
with gr.Row():
|
73 |
with gr.Column(scale=1):
|
74 |
test_instruction = gr.Textbox(lines=4, value="", label="Prompt to test")
|
75 |
test_input = gr.Textbox(lines=4, value="", label="Inputs used to test prompt[多个输入以换行分割]")
|
@@ -79,7 +79,7 @@ with gr.Blocks(title="Automatic Prompt Engineer", theme=gr.themes.Glass()) as de
|
|
79 |
|
80 |
with gr.Tab("指令评估"):
|
81 |
# By Default use the Evaluation Set in APE
|
82 |
-
with gr.Row():
|
83 |
with gr.Column(scale=1):
|
84 |
score_instruction = gr.Textbox(lines=3, value="",
|
85 |
label="Prompt to Evaluate")
|
@@ -92,7 +92,7 @@ with gr.Blocks(title="Automatic Prompt Engineer", theme=gr.themes.Glass()) as de
|
|
92 |
gr.Markdown('\n\n')
|
93 |
gr.Markdown("# SELF INSTRUCT")
|
94 |
gr.Markdown('## 第一步:确认参数并上传种子指令')
|
95 |
-
with gr.Row():
|
96 |
with gr.Column():
|
97 |
n_human = gr.Slider(label="人工指令数", minimum=1, maximum=5, step=1, value=2)
|
98 |
n_machine = gr.Slider(label="机器指令数", minimum=1, maximum=5, step=1, value=1)
|
@@ -108,13 +108,13 @@ with gr.Blocks(title="Automatic Prompt Engineer", theme=gr.themes.Glass()) as de
|
|
108 |
|
109 |
gr.Markdown('\n\n')
|
110 |
gr.Markdown('## 第二步:采样并生成新指令,每点一次会重采样并生成,生成结果会累计')
|
111 |
-
with gr.Row():
|
112 |
with gr.Column(scale=1):
|
113 |
fewshot = gr.Textbox(label='采样few-shot')
|
114 |
with gr.Column(scale=1):
|
115 |
gen_data = gr.JSON(label='新生成指令样本')
|
116 |
|
117 |
-
with gr.Row():
|
118 |
with gr.Column(scale=7):
|
119 |
generate_instruct_button = gr.Button("指令生成")
|
120 |
with gr.Column(scale=1):
|
|
|
9 |
|
10 |
with gr.Blocks(title="Automatic Prompt Engineer", theme=gr.themes.Glass()) as demo:
|
11 |
gr.Markdown("# Automatic Prompt Engineer")
|
12 |
+
with gr.Row().style(equal_height=True):
|
13 |
with gr.Column(scale=2):
|
14 |
gr.Markdown("## 第一步:输入参数")
|
15 |
with gr.Row():
|
|
|
24 |
with gr.Column(scale=3):
|
25 |
gr.Markdown("## 第二步:加载数据(选任务或上传数据)")
|
26 |
with gr.Tab("选择数据"):
|
27 |
+
with gr.Row().style(equal_height=True):
|
28 |
file = gr.File(label='上传txt文件,input[空格]output[换行]')
|
29 |
+
with gr.Row().style(equal_height=True):
|
30 |
task = gr.Dropdown(label="Chosse Existing Task", choices=list(LoadFactory.keys()), value=None)
|
31 |
+
with gr.Row().style(equal_height=True):
|
32 |
instance = gr.State()
|
33 |
load_button = gr.Button("Load Task")
|
34 |
load_flag = gr.Textbox()
|
|
|
40 |
train_str = gr.Textbox(max_lines=100, lines=10, label="Data for prompt generation")
|
41 |
eval_str = gr.Textbox(max_lines=100, lines=10, label="Data for scoring")
|
42 |
|
43 |
+
with gr.Row().style(equal_height=True):
|
44 |
with gr.Column(scale=2):
|
45 |
gr.Markdown("## 第三步: Run APE(可替换默认指令)")
|
46 |
gen_prompt = gr.Textbox(max_lines=100, lines=3, interative=True,
|
|
|
53 |
placeholder=MyTemplate['test_prompt'],
|
54 |
value='', label="Prompt for Single Test")
|
55 |
|
56 |
+
with gr.Row().style(equal_height=True):
|
57 |
cost = gr.Textbox(lines=1, value="", label="Estimated Cost ($)")
|
58 |
cost_button = gr.Button("Estimate Cost")
|
59 |
+
with gr.Row().style(equal_height=True):
|
60 |
gen_button = gr.Button("Generate")
|
61 |
eval_button = gr.Button("Eval")
|
62 |
|
|
|
69 |
|
70 |
with gr.Tab("指令单测"):
|
71 |
# Test the output of LLM using prompt
|
72 |
+
with gr.Row().style(equal_height=True):
|
73 |
with gr.Column(scale=1):
|
74 |
test_instruction = gr.Textbox(lines=4, value="", label="Prompt to test")
|
75 |
test_input = gr.Textbox(lines=4, value="", label="Inputs used to test prompt[多个输入以换行分割]")
|
|
|
79 |
|
80 |
with gr.Tab("指令评估"):
|
81 |
# By Default use the Evaluation Set in APE
|
82 |
+
with gr.Row().style(equal_height=True):
|
83 |
with gr.Column(scale=1):
|
84 |
score_instruction = gr.Textbox(lines=3, value="",
|
85 |
label="Prompt to Evaluate")
|
|
|
92 |
gr.Markdown('\n\n')
|
93 |
gr.Markdown("# SELF INSTRUCT")
|
94 |
gr.Markdown('## 第一步:确认参数并上传种子指令')
|
95 |
+
with gr.Row().style(equal_height=True):
|
96 |
with gr.Column():
|
97 |
n_human = gr.Slider(label="人工指令数", minimum=1, maximum=5, step=1, value=2)
|
98 |
n_machine = gr.Slider(label="机器指令数", minimum=1, maximum=5, step=1, value=1)
|
|
|
108 |
|
109 |
gr.Markdown('\n\n')
|
110 |
gr.Markdown('## 第二步:采样并生成新指令,每点一次会重采样并生成,生成结果会累计')
|
111 |
+
with gr.Row().style(equal_height=True):
|
112 |
with gr.Column(scale=1):
|
113 |
fewshot = gr.Textbox(label='采样few-shot')
|
114 |
with gr.Column(scale=1):
|
115 |
gen_data = gr.JSON(label='新生成指令样本')
|
116 |
|
117 |
+
with gr.Row().style(equal_height=True):
|
118 |
with gr.Column(scale=7):
|
119 |
generate_instruct_button = gr.Button("指令生成")
|
120 |
with gr.Column(scale=1):
|
self/__pycache__/generate.cpython-38.pyc
CHANGED
Binary files a/self/__pycache__/generate.cpython-38.pyc and b/self/__pycache__/generate.cpython-38.pyc differ
|
|