ZhuiyiTechnology / t5-pegasus

中文生成式预训练模型

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问推理怎么改造成batchsize>1的?

geolvr opened this issue · comments

好像主要是beam search那块不支持

test_data = load_data('test_data.xlsx')
for i in range(len(test_data)): 
      title = test_data[i][0]
      content = test_data[i][1]
      pred = ''.join(autotitle.generate(content,topk=1)).lower()

这是我的推理过程,速度非常慢,不知道写得对不对,有没有更好的方法。

test_data = load_data('test_data.xlsx')
for i in range(len(test_data)): 
      title = test_data[i][0]
      content = test_data[i][1]
      pred = ''.join(autotitle.generate(content,topk=1)).lower()

这是我的推理过程,速度非常慢,不知道写得对不对,有没有更好的方法。

这不是和原代码一样吗,还是batchsize为1