in src/models/struxgpt_v2.py [0:0]
def prepare_prompt(self, text: str, **kwargs):
if kwargs.get('input_sent_enum', False):
sentences_str = text
else:
sentence_list = []
for para in text.splitlines():
if len(white_space_fix(para)) == 0:
continue
sentence_list.extend(self.split_to_sentence(para))
sentences_str = self.mapping_sentence(sentence_list)
prompt = self.map_prompt_template(sentences=sentences_str)
if kwargs.get('return_sentences_str', False):
return prompt, sentences_str
else:
return prompt