LaVieEnRose365 / ReLLa

Code of Paper "ReLLa: Retrieval-enhanced Large Language Models for Mitigating Long Context Problems in Recommendation".
41 stars 4 forks source link

数据预处理代码报错 #5

Closed zhuorson closed 8 months ago

zhuorson commented 8 months ago

Cell In[17], line 15 12 for split in user_seq[hist_name]: 13 if hist_name != "history length": 14 user_seq_trunc[hist_name][split] = pad_sequence( ---> 15 [torch.tensor(x[-30:]) for x in user_seq[hist_name][split]], 16 batch_first=True, 17 ) 18 else: 19 user_seq_trunc["history mask"][split] = pad_sequence( 20 [torch.ones(min(x, 30)) for x in user_seq[hist_name][split]], 21 batch_first=True, 22 )

ValueError: too many dimensions 'str' 请问哪里有问题?

LaVieEnRose365 commented 8 months ago

您好!这里是因为存储的时候忘记把id类型转成int,我们已经修复了bug并更新了ml-1m.ipynb, 并且保留了正确的cell运行输出。 我们也在README中附上了处理好的prompt,包括论文中使用到的训练集合和全量测试集。方便大家直接使用。 感谢您对我们工作的支持!