Spaces:
Runtime error
Runtime error
Upload utils.py
Browse files- src/utils.py +5 -6
src/utils.py
CHANGED
|
@@ -9,12 +9,11 @@ def post_process_template(tB):
|
|
| 9 |
|
| 10 |
|
| 11 |
def construct_template(words, templateA, if_then=False):
|
| 12 |
-
if len(words) =
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
]
|
| 18 |
elif len(words) == 1:
|
| 19 |
templates = [
|
| 20 |
# '{} is <mask>.'.format(words[0]),
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
def construct_template(words, templateA, if_then=False):
|
| 12 |
+
if len(words) >= 2:
|
| 13 |
+
templates = ['{} <mask> '.format(words[0])]
|
| 14 |
+
for i in range(1, len(words)-1):
|
| 15 |
+
templates[0] += '{} <mask> '.format(words[i])
|
| 16 |
+
templates[0] += '{}.'.format(words[-1])
|
|
|
|
| 17 |
elif len(words) == 1:
|
| 18 |
templates = [
|
| 19 |
# '{} is <mask>.'.format(words[0]),
|