bert4torch icon indicating copy to clipboard operation
bert4torch copied to clipboard

An elegent pytorch implement of transformers

Results 31 bert4torch issues
Sort by recently updated
recently updated
newest added

这个模块中输入的pytorch_model.bin文件是使用convert_nezha_gpt_dialog.py这个脚本对苏神提供的tf版的chinese_nezha_gpt_L-12_H-768_A-12模型进行转换而来的吗?

1、basic_language_model_CDial_GPT.py 文件测试的时候显示生成的文字杂七杂八的。 解决方法: @AutoRegressiveDecoder.wraps(default_rtype='probas') 中的probas改为logits 2、basic_language_model_nezha_gpt_dialog.py 文件测试的时候报错 ![image](https://user-images.githubusercontent.com/44089413/183326789-bb0c74f2-a6c0-4de8-bd90-ea5fbe1a4d64.png) 解决:主要问题是model的转换,之前是自己写的,有些层写的不对,参看convert中的转换就没问题。另外相对距离的计算,波哥在配置文件中添加了,bert4keras则是在代码里实现。

这个example中 输入:[CLS]科学[MASK][MASK]是第一生产力[SEP] 预测出来的结果是,,两个逗号,而不是技术 使用的模型是hugging face 模型库中的bert-base-chinese。 模型加载过程中出现大量警告: ![image](https://user-images.githubusercontent.com/22750382/183279067-c84bad9e-4958-4eec-9581-3b49a65b7d69.png) 请问只是啥问题?

![image](https://user-images.githubusercontent.com/42829645/179023257-b3563c29-569c-42ae-848d-b1f1fea1d5b6.png)

bug

Traceback (most recent call last): File "C:/Users/Administrator/Desktop/bert_crf/train.py", line 191, in model.fit(train_dataloader, epochs=20, steps_per_epoch=None, callbacks=[evaluator]) File "D:\python36\lib\site-packages\bert4torch\models.py", line 213, in fit output, loss, loss_detail = self.train_step(train_X, train_y, grad_accumulation_steps) File "D:\python36\lib\site-packages\bert4torch\models.py", line...

在脚本layers.py中55行,cond = cond.unsqueeze(dim=1),这里的dim应该是等于0吧,调试发现是不太对的,老哥确认下

你好! 非常感谢作者编写的这套torch框架,gradient-checkpointing是种可以节省显存的训练方法,对于资源紧张下训练大模型有比较大的帮助作用,在苏神的博客上也有介绍,huggingface的transformers也内置了相关支持,是否能在后期加上这个功能?

不少issue是关于预训练模型加载出错的,包含报warning和config参数不对,解释如下 - 原因:报warning是因为模型文件中的key和bert4torch的key没有完全对齐,config参数不对是笔者对原config文件做了修改(方便参数名统一) - 解决方案:可以直接查看[README文件结尾](https://github.com/Tongjilibo/bert4torch/blob/master/README.md),部分预训练权重提供了[convert文件](https://github.com/Tongjilibo/bert4torch/tree/master/examples/convert_script),config参数提供了[config说明](https://github.com/Tongjilibo/bert4torch/blob/master/examples/convert_script/PLM_config.md)

documentation

请教下,tensorrt trtexec把onnx转换成fp32的trt时,是没有问题的,但是转换成fp16,误差很大,基本不可用;不知道你这边有没有转成fp16的trt,有没有问题?