You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: promptsource/templates/selqa/answer_selection_analysis/templates.yaml
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,11 @@ templates:
18
18
5354e98d-8aa2-49d0-a50b-fc72a503d7d4: !Template
19
19
answer_choices: No ||| Yes
20
20
id: 5354e98d-8aa2-49d0-a50b-fc72a503d7d4
21
-
jinja: '{% set possible_indexes = [] %}{% for c in candidates %}{% if c|trim %}{% set _ = possible_indexes.append(loop.index0) %}{% endif %}{% endfor %}{% set rand_index = possible_indexes | choice %} Would it make
22
-
sense to reply "{{ candidates[rand_index]|trim|trim(''.'') }}" to the question
23
-
"{{ question }}"? ||| {% if rand_index in answers %}{{answer_choices[1]}}{%else %}{{answer_choices[0]}}{%endif%}'
21
+
jinja: '{% set possible_indexes = [] %}{% for c in candidates %}{% if c|trim %}{{
22
+
possible_indexes.append(loop.index0) | default("", True) }}{% endif %}{% endfor %}{% set
23
+
rand_index = possible_indexes | choice %} Would it make sense to reply "{{ candidates[rand_index]|trim|trim(''.'')
24
+
}}" to the question "{{ question }}"? ||| {% if rand_index in answers %}{{answer_choices[1]}}{%else
25
+
%}{{answer_choices[0]}}{%endif%}'
24
26
metadata: !TemplateMetadata
25
27
choices_in_prompt: false
26
28
metrics:
@@ -46,8 +48,11 @@ templates:
46
48
9de0a553-63e7-4b67-a6c5-1a15ac0d5483: !Template
47
49
answer_choices: No ||| Yes
48
50
id: 9de0a553-63e7-4b67-a6c5-1a15ac0d5483
49
-
jinja: '{% set possible_indexes = [] %}{% for c in candidates %}{% if c|trim %}{% set _ = possible_indexes.append(loop.index0) %}{% endif %}{% endfor %}{% set rand_index = possible_indexes | choice %}Someone asked me "{{ question }}" I replied "{{ candidates[rand_index] }}" Does
50
-
my answer make sense? ||| {% if rand_index in answers %}{{answer_choices[1]}}{%else %}{{answer_choices[0]}}{%endif%}
51
+
jinja: '{% set possible_indexes = [] %}{% for c in candidates %}{% if c|trim %}{{
0 commit comments