Skip to content

Commit

Permalink
Fixed instantiation of prompts with no communities
Browse files Browse the repository at this point in the history
  • Loading branch information
tirafrutas committed Jun 19, 2024
1 parent a6111f0 commit 9d1e59e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions langbite/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,15 @@ def __init__(self, id, concern: ConcernKind, input_type: InputKind, reflection_t
self.__responses = [PromptResponse]

def instantiate(self, concern, communities):
# TODO: markup might be an attribute of the ethical concern
# markup might be an attribute of the ethical concern
markup = MARKUPS[concern]

if len(communities) > 0:
lang_communities = communities[self.language]
self.__instances = self.__replace_markups(markup, lang_communities)
if len(lang_communities) > 0:
self.__instances = self.__replace_markups(markup, lang_communities)
else:
self.__instances = [self.template]
else:
self.__instances = [self.template]

Expand Down

0 comments on commit 9d1e59e

Please sign in to comment.