摘要: ```python import torch def promptGating(gating, adding, x): ''' gating: (num_prefix, dim) adding: (num_prefix, dim) x: (seq_length, batch_size, dim) ' 阅读全文
posted @ 2023-08-09 17:34 鸽鸽的书房 阅读(18) 评论(0) 推荐(0) 编辑
摘要: prefix_tuning.py ```python import torch from transformers import PretrainedConfig class PrefixEncoder(torch.nn.Module): r''' The torch.nn model to enc 阅读全文
posted @ 2023-08-09 15:09 鸽鸽的书房 阅读(150) 评论(0) 推荐(0) 编辑