Spaces:
Runtime error
Runtime error
fix: sanity check message pairs in the post process
Browse files401 unmodified lines4024034044054064074 unmodified lines412413414415416417418401 unmodified linesreturn []processed_messages = []for message_pair in y:if not isinstance(message_pair, (tuple, list)):raise TypeError(f"Expected a list of lists or list of tuples. Received: {message_pair}"4 unmodified lines)processed_messages.append([None,self._postprocess_chat_messages((message_pair[0]+message_pair[1]).replace(';','\n').replace('\\','\t'))#self._postprocess_chat_messages(message_pair[1])),])401 unmodified lines4024034044054064074084094104114124134 unmodified lines418419420421422423424401 unmodified linesreturn []processed_messages = []for message_pair in y:result = ""print('Message Pairs: ',message_pair[0],message_pair[1])if message_pair[0] is not None:result += message_pair[0]if message_pair[1] is not None:result += message_pair[1]if not isinstance(message_pair, (tuple, list)):raise TypeError(f"Expected a list of lists or list of tuples. Received: {message_pair}"4 unmodified lines)processed_messages.append([None,self._postprocess_chat_messages((result).replace(';','\n').replace('\\','\t'))#self._postprocess_chat_messages(message_pair[1])),])
app.py+7-1