def _load_personas(opt):
    print('[ loading personas.. ]')
    convai2_opt = opt.copy()
    convai2_opt['task'] = 'convai2:both'
    if convai2_opt['datatype'].startswith('train'):
        convai2_opt['datatype'] = 'train:evalmode'
    convai2_opt['interactive_task'] = False
    convai2_opt['selfchat_task'] = False
    convai2_agent = FixedResponseAgent({'fixed_response': None})
    convai2_world = create_task(convai2_opt, convai2_agent)
    personas = set()
    while (not convai2_world.epoch_done()):
        convai2_world.parley()
        msg = convai2_world.get_acts()[0]
        if (msg.get('episode_done', False) and (not convai2_world.epoch_done())):
            convai2_world.parley()
            msg = convai2_world.get_acts()[0]
            txt = msg.get('text', '').split('\n')
            a1_persona = []
            a2_persona = []
            for t in txt:
                if t.startswith("partner's persona:"):
                    a1_persona.append(t.replace("partner's persona:", 'your persona:'))
                if t.startswith('your persona:'):
                    a2_persona.append(t)
            personas.add('\n'.join(a1_persona))
            personas.add('\n'.join(a2_persona))
    print((('[ loaded ' + str(len(personas))) + ' personas ]'))
    return list(personas)
def _load_personas(opt):
    print('[ loading personas.. ]')
    convai2_opt = opt.copy()
    convai2_opt['task'] = 'convai2:both'
    if convai2_opt['datatype'].startswith('train'):
        convai2_opt['datatype'] = 'train:evalmode'
    convai2_opt['interactive_task'] = False
    convai2_opt['selfchat_task'] = False
    convai2_agent = FixedResponseAgent({'fixed_response': None})
    convai2_world = create_task(convai2_opt, convai2_agent)
    personas = set()
    while (not convai2_world.epoch_done()):
        convai2_world.parley()
        msg = convai2_world.get_acts()[0]
        if (msg.get('episode_done', False) and (not convai2_world.epoch_done())):
            convai2_world.parley()
            msg = convai2_world.get_acts()[0]
            txt = msg.get('text', ).split('\n')
            a1_persona = []
            a2_persona = []
            for t in txt:
                if t.startswith("partner's persona:"):
                    a1_persona.append(t.replace("partner's persona:", 'your persona:'))
                if t.startswith('your persona:'):
                    a2_persona.append(t)
            personas.add('\n'.join(a1_persona))
            personas.add('\n'.join(a2_persona))
    print((('[ loaded ' + str(len(personas))) + ' personas ]'))
    return list(personas)