Spaces:
Runtime error
Runtime error
- ape/data/test_loader.txt +15 -0
- ape/instance.py +6 -1
- app.py +1 -1
ape/data/test_loader.txt
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
sane insane
|
2 |
+
direct indirect
|
3 |
+
informally formally
|
4 |
+
unpopular popular
|
5 |
+
subtractive additive
|
6 |
+
nonresidential residential
|
7 |
+
inexact exact
|
8 |
+
uptown downtown
|
9 |
+
incomparable comparable
|
10 |
+
powerful powerless
|
11 |
+
gaseous solid
|
12 |
+
evenly unevenly
|
13 |
+
formality informality
|
14 |
+
deliberately accidentally
|
15 |
+
off on
|
ape/instance.py
CHANGED
@@ -91,7 +91,7 @@ def load_intent(file='./ape/data/intent_train.csv'):
|
|
91 |
|
92 |
def upload_file(file):
|
93 |
tuple_list = []
|
94 |
-
with open(file, 'r') as f:
|
95 |
for i in f.readlines():
|
96 |
input, output = i.split(' ')
|
97 |
tuple_list.append((input, output))
|
@@ -122,3 +122,8 @@ if __name__ == '__main__':
|
|
122 |
print(instance2.display(instance2.train_samples))
|
123 |
train_iter = instance2.get_train_iter()
|
124 |
print(next(train_iter))
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
def upload_file(file):
|
93 |
tuple_list = []
|
94 |
+
with open(file, 'r', encoding='UTF-8') as f:
|
95 |
for i in f.readlines():
|
96 |
input, output = i.split(' ')
|
97 |
tuple_list.append((input, output))
|
|
|
122 |
print(instance2.display(instance2.train_samples))
|
123 |
train_iter = instance2.get_train_iter()
|
124 |
print(next(train_iter))
|
125 |
+
|
126 |
+
|
127 |
+
with open('./ape/data/test_loader.txt','w') as f:
|
128 |
+
for i in samples:
|
129 |
+
f.write(f'{i[0]} {i[1]}\n')
|
app.py
CHANGED
@@ -24,7 +24,7 @@ with gr.Blocks(title="Automatic Prompt Engineer", theme=gr.themes.Glass()) as de
|
|
24 |
gr.Markdown("## 第二步:加载数据")
|
25 |
with gr.Tab("选择数据"):
|
26 |
with gr.Row():
|
27 |
-
file = gr.File(label='上传txt文件,input
|
28 |
with gr.Row():
|
29 |
task = gr.Dropdown(label="Chosse Existing Task", choices=list(LoadFactory.keys()), value=None)
|
30 |
with gr.Row():
|
|
|
24 |
gr.Markdown("## 第二步:加载数据")
|
25 |
with gr.Tab("选择数据"):
|
26 |
with gr.Row():
|
27 |
+
file = gr.File(label='上传txt文件,input[空格]output[换行]')
|
28 |
with gr.Row():
|
29 |
task = gr.Dropdown(label="Chosse Existing Task", choices=list(LoadFactory.keys()), value=None)
|
30 |
with gr.Row():
|