Thank you for open sourcing this repository.
I'm having trouble when decoding an expert model.
python3 main.py --model experts --label_smoothing --noam --emb_dim 300 --hidden_dim 300 --hop 1 --heads 2 --topk 5 --cuda --pretrain_emb --softmax --basic_learner --schedule 10000 --save_path save/moel/
Traceback (most recent call last):
File "main.py", line 97, in <module>
loss_test, ppl_test, bce_test, acc_test, bleu_score_g, bleu_score_b= evaluate(model, data_loader_tst ,ty="test", max_dec_step=50)
File "/home/repos/empathetic_systems/MoEL/model/common_layer.py", line 824, in evaluate
sent_b = t.beam_search(batch, max_dec_step=max_dec_step)
File "/home/repos/empathetic_systems/MoEL/utils/beam_omt_experts.py", line 273, in beam_search
active_inst_idx_list = beam_decode_step(inst_dec_beams, len_dec_seq, src_seq, src_enc, inst_idx_to_position_map, n_bm, enc_batch_extend_vocab, extra_zeros, mask_src, encoder_db, mask_transformer_db, DB_ext_vocab_batch)
File "/home/repos/empathetic_systems/MoEL/utils/beam_omt_experts.py", line 205, in beam_decode_step
dec_seq = prepare_beam_dec_seq(inst_dec_beams, len_dec_seq)
File "/home/repos/empathetic_systems/MoEL/utils/beam_omt_experts.py", line 157, in prepare_beam_dec_seq
dec_partial_seq = [b.get_current_state() for b in inst_dec_beams if not b.done]
File "/home/repos/empathetic_systems/MoEL/utils/beam_omt_experts.py", line 157, in <listcomp>
dec_partial_seq = [b.get_current_state() for b in inst_dec_beams if not b.done]
File "/home/repos/empathetic_systems/MoEL/utils/beam_omt_experts.py", line 33, in get_current_state
return self.get_tentative_hypothesis()
File "/home/repos/empathetic_systems/MoEL/utils/beam_omt_experts.py", line 90, in get_tentative_hypothesis
hyps = [self.get_hypothesis(k) for k in keys]
File "/home/repos/empathetic_systems/MoEL/utils/beam_omt_experts.py", line 90, in <listcomp>
hyps = [self.get_hypothesis(k) for k in keys]
File "/home/repos/empathetic_systems/MoEL/utils/beam_omt_experts.py", line 100, in get_hypothesis
hyp.append(self.next_ys[j+1][k])
IndexError: tensors used as indices must be long, byte or bool tensors
(Pdb) pp k
tensor(0.0014, device='cuda:0')
(Pdb) self.prev_ks
[tensor([0.0026, 0.0054, 0.0003, 0.0069, 0.0075], device='cuda:0'), tensor([1.4338e-03, 1.0014e+00, 2.0014e+00, 7.5908e-04, 1.0008e+00],
device='cuda:0')]
Thank you in advance.