![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
自然语言处理
文章平均质量分 50
weixin_41318625
这个作者很懒,什么都没留下…
展开
-
autograd error
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.LongTensor [896, 1]] is at version 11539; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed原创 2022-04-03 15:41:55 · 389 阅读 · 0 评论 -
bert 预训练模型的使用(pytorch)
import numpy as npimport torch from transformers import BertTokenizer, BertConfig, BertForMaskedLM, BertForNextSentencePredictionfrom transformers import BertModelmodel_name = 'bert-base-chinese'MODEL_PATH = 'F:/Transformer-Bert/bert-base-chinese/'转载 2022-03-15 14:38:32 · 3641 阅读 · 4 评论 -
PET prompt pattern expoliting traning
https://zhuanlan.zhihu.com/p/462469487转载 2022-02-17 14:20:06 · 147 阅读 · 0 评论 -
fairseq框架下代码分析---模型构建(guided_transformer)
1. 首先定义的类是整个模型的类GuidedTransformerModel(FairseqEncoderDecoderMoel)通过@register的方式注册模型,模型继承FairseqEncoderDecoderModel@register_model("guided_transformer")class GuidedTransformerModel(FairseqEncoderDecoderModel):1)定义init函数 def __init__(self, args, enc原创 2022-01-19 10:31:39 · 4298 阅读 · 2 评论