def calc_l2v_weights(args, lang, lang_adapter_names):
    adapter_weight = []
    for adapter_lang in lang_adapter_names:
        if ((args.en_weight is not None) and (adapter_lang == 'en')):
            continue
        if (args.lang_to_vec == 'learned'):
            adapter_weight.append(get_sim(lang, adapter_lang))
        elif (args.lang_to_vec == 'syntax'):
            adapter_weight.append(get_syntax_sim(lang, adapter_lang))
        else:
            logger.info('INVALID FEATURE TYPE')
            exit()
    logger.info(adapter_weight)
    adapter_weight = torch.FloatTensor(adapter_weight)
    adapter_weight = torch.nn.functional.softmax((adapter_weight / args.temperature)).tolist()
    if (args.en_weight is not None):
        adapter_weight = [((1 - args.en_weight) * aw) for aw in adapter_weight]
        en_index = lang_adapter_names.index('en')
        adapter_weight.insert(en_index, args.en_weight)
    return adapter_weight
def calc_l2v_weights(args, lang, lang_adapter_names):
    adapter_weight = []
    for adapter_lang in lang_adapter_names:
        if ((args.en_weight is not None) and (adapter_lang == 'en')):
            continue
        if (args.lang_to_vec == 'learned'):
            adapter_weight.append(get_sim(lang, adapter_lang))
        elif (args.lang_to_vec == 'syntax'):
            adapter_weight.append(get_syntax_sim(lang, adapter_lang))
        else:
            logger.info('INVALID FEATURE TYPE')
            exit()
    logger.info(adapter_weight)
    adapter_weight = torch.FloatTensor(adapter_weight)
    adapter_weight = torch.nn.functional.softmax((adapter_weight / args.temperature)).tolist()
    if (args.en_weight is not None):
        adapter_weight = [((1 - args.en_weight) * aw) for aw in adapter_weight]
        en_index = lang_adapter_names.index('en')
        adapter_weight.insert(en_index, args.en_weight)
    return adapter_weight