Skip to content

Commit 9d1e59e

Browse files
committed
Fixed instantiation of prompts with no communities
1 parent a6111f0 commit 9d1e59e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

langbite/prompt.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,15 @@ def __init__(self, id, concern: ConcernKind, input_type: InputKind, reflection_t
110110
self.__responses = [PromptResponse]
111111

112112
def instantiate(self, concern, communities):
113-
# TODO: markup might be an attribute of the ethical concern
113+
# markup might be an attribute of the ethical concern
114114
markup = MARKUPS[concern]
115115

116116
if len(communities) > 0:
117117
lang_communities = communities[self.language]
118-
self.__instances = self.__replace_markups(markup, lang_communities)
118+
if len(lang_communities) > 0:
119+
self.__instances = self.__replace_markups(markup, lang_communities)
120+
else:
121+
self.__instances = [self.template]
119122
else:
120123
self.__instances = [self.template]
121124

0 commit comments

Comments
 (0)