Skip to content

Commit ab6ad7e

Browse files
authored
fix empty documents - multi_news (#793)
* fix empty documents - multi_news * fix test - unrecognized variable
1 parent 6b1560f commit ab6ad7e

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

promptsource/templates/multi_news/templates.yaml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ templates:
66
jinja: '{% set docs = document.split("3ed2dface8203c4c9dfb1a5dc58e41e0||") | reject("equalto",
77
"") | list %}
88
9+
{% if document != "" %}
10+
911
What are the key points across these news articles:
1012
1113
{% for doc in docs %}
@@ -17,7 +19,9 @@ templates:
1719
1820
|||
1921
20-
{{summary[2:]}}'
22+
{{summary[2:]}}
23+
24+
{% endif %}'
2125
metadata: !TemplateMetadata
2226
choices_in_prompt: false
2327
metrics:
@@ -32,6 +36,8 @@ templates:
3236
jinja: '{% set docs = document.split("3ed2dface8203c4c9dfb1a5dc58e41e0||") | reject("equalto",
3337
"") | list %}
3438
39+
{% if document != "" %}
40+
3541
Synthesize these documents into a single one:
3642
3743
{% for doc in docs %}
@@ -43,7 +49,9 @@ templates:
4349
4450
|||
4551
46-
{{summary[2:]}}'
52+
{{summary[2:]}}
53+
54+
{% endif %}'
4755
metadata: !TemplateMetadata
4856
choices_in_prompt: false
4957
metrics:
@@ -58,6 +66,8 @@ templates:
5866
jinja: '{% set docs = document.split("3ed2dface8203c4c9dfb1a5dc58e41e0||") | reject("equalto",
5967
"") | list %}
6068
69+
{% if document != "" %}
70+
6171
I want to edit the following articles into a more concise summary:
6272
6373
{% for doc in docs %}
@@ -69,7 +79,9 @@ templates:
6979
7080
|||
7181
72-
{{summary[2:]}}'
82+
{{summary[2:]}}
83+
84+
{% endif %}'
7385
metadata: !TemplateMetadata
7486
choices_in_prompt: false
7587
metrics:
@@ -84,6 +96,8 @@ templates:
8496
jinja: '{% set docs = document.split("3ed2dface8203c4c9dfb1a5dc58e41e0||") | reject("equalto",
8597
"") | list %}
8698
99+
{% if document != "" %}
100+
87101
Write a summary of the following articles:
88102
89103
{% for doc in docs %}
@@ -95,7 +109,9 @@ templates:
95109
96110
|||
97111
98-
{{summary[2:]}}'
112+
{{summary[2:]}}
113+
114+
{% endif %}'
99115
metadata: !TemplateMetadata
100116
choices_in_prompt: false
101117
metrics:
@@ -110,13 +126,17 @@ templates:
110126
jinja: '{% set docs = document.split("3ed2dface8203c4c9dfb1a5dc58e41e0||") | reject("equalto",
111127
"") | list%}
112128
129+
{% if document != "" %}
130+
113131
Write an expanded news article with plausible details from the following summary:
114132
115133
{{summary[2:]}}
116134
117135
|||
118136
119-
{{docs | choice}}'
137+
{{docs | choice}}
138+
139+
{% endif %}'
120140
metadata: !TemplateMetadata
121141
choices_in_prompt: false
122142
metrics:
@@ -131,6 +151,8 @@ templates:
131151
jinja: '{% set docs = document.split("3ed2dface8203c4c9dfb1a5dc58e41e0||") | reject("equalto",
132152
"") | list %}
133153
154+
{% if document != "" %}
155+
134156
I''m trying to distill these articles down into one:
135157
136158
{% for doc in docs %}
@@ -142,7 +164,9 @@ templates:
142164
143165
|||
144166
145-
{{summary[2:]}}'
167+
{{summary[2:]}}
168+
169+
{% endif %}'
146170
metadata: !TemplateMetadata
147171
choices_in_prompt: false
148172
metrics:

0 commit comments

Comments
 (0)