bert4torch

An elegent pytorch implement of transformers

MIT License

Downloads
2K
Stars
1.2K
Committers
8

Bot releases are visible (Hide)

bert4torch - 稳定版本v0.3.4

Published by Tongjilibo about 1 year ago

  1. 修复gradient_checkpoint在低版本torch时仅支持位置参数的问题
  2. 增加trainer.py
  3. 增加PPOTrainerTrl以及相应的三阶段rlhf训练+dpo训练
bert4torch - 稳定版本v0.3.3

Published by Tongjilibo about 1 year ago

增加大模型deepspeed的使用,增加Qwen模型(增加ntk和logn_attn),generation的end_id支持多个token_id,修复多文件权重加载资源占用问题

bert4torch - 稳定版本v0.3.2

Published by Tongjilibo about 1 year ago

1、修改baichuan的alibi逻辑
2、增加bloom
3、简化decoder架构代码(gpt, llama, chatglm均继承decoder)
4、适配torch4keras==0.1.1, 其中增加了move_to_model_device,进度条和日志同步,log_first_step等功能

bert4torch - 稳定版本v0.3.0

Published by Tongjilibo over 1 year ago

修改models和layers为文件夹方便扩展, 增加flash_attention参数控制,修改skip_init逻辑减少显存占用,generation增加repetition_penalty,修复chatglm的pv2的bug,generation支持transformers的tokenize,增加ziya,Baichuan

bert4torch - 稳定版本v0.2.9

Published by Tongjilibo over 1 year ago

使用accelerate来实现skip_init精简代码, 修复add_trainer的代码提示, 增加chatglm的load_in_8bit+lora/qlora的训练, 修复grad_chechpoint, 增加chinese_llama_alpaca, torch2.0默认使用scaled_dot_product_attention加速, 增加chatglm2-6b+pv2+lora微调

bert4torch - 稳定版本v0.2.8

Published by Tongjilibo over 1 year ago

【新增模型】增加chatglm-6b/llama-7b/BELLE_llama/vicuna/moss/苏神、uer的roberta-small/Tiny模型以及ChatYuan v2模型/fnlp的bart2.0, 增加量化模块并适配llama,增加skip_init参数加快加载, 增加stream输出/网页demo, 增加ptuning_v2和lora;
【generation】生成式解码新增SeqGeneration和Seq2SeqGeneration,单向decoder模型和encoder decoder模型解码增加cache, 增加batch_generate()/stream_generate功能;
【其他】修改rope为不使用max_position,修复model.half()类型不一致问题,支持加载多个权重文件, gpt系列默认不加softmax,增加苏神Tiger的pytorch实现, 增加了对attention_key_size的入参支持,把_token_pad_ids重命名为pad_token_ids, tokenizor中重命名部分字段

bert4torch - 稳定版本v0.2.7.post2

Published by Tongjilibo over 1 year ago

修复albert_unshared加载权重, 修复lm系列(gpt, seq2seq)存在的forward参数不对的问题,修复GlobalPointer使用rope的bug,增加lion优化器

bert4torch - 稳定版本v0.2.7

Published by Tongjilibo over 1 year ago

修复random_sample()的bug,适配v0.0.6的torch4keras:增加resume_from_checkpoint和save_to_checkpoint;增加add_trainer方法,重构了Trainer(BaseModel)的实现,增加了AccelerateCallback

bert4torch - 稳定版本v0.2.6

Published by Tongjilibo almost 2 years ago

build_transformer_model需显式指定add_trainer才从BaseModel继承, 增加guwenbert, macbert,text2vec-bert-chinese, wobert预训练模型,允许position_ids从padding开始, transformer.configs支持点操作,可以使用torch4keras的Trainer(net)来初始化, 修复tokenizer的切分subtoken的bug, 允许embedding_size!=hidden_size

bert4torch - 稳定版本v0.2.5

Published by Tongjilibo almost 2 years ago

对抗训练从compile转为使用Callback来实现,修复1.7.1版本兼容bug, uie模型内置

bert4torch - 稳定版本v0.2.4

Published by Tongjilibo almost 2 years ago

增加deberta_v2模型

bert4torch - 稳定版本v0.2.3

Published by Tongjilibo almost 2 years ago

虚拟对抗VAT在多个ouput时支持指定,把Trainer抽象到torch4keras中,修复DP和DDP出现resume_epoch不存在的bug, tokenizer的never_split去除None, transformer_xl的bug, 增加gradient_checkpoint

bert4torch - 稳定版本v0.2.2

Published by Tongjilibo about 2 years ago

修复t5的norm_mode问题,允许hidden_size不整除num_attention_heads, 支持多个schedule(如同时ema+warmup)

bert4torch - 稳定版本v0.2.1

Published by Tongjilibo about 2 years ago

兼容torch<=1.7.1的torch.div无rounding_mode, 增加自定义metrics,支持断点续训,增加默认Logger和Tensorboard日志

bert4torch - 稳定版本v0.2.0

Published by Tongjilibo about 2 years ago

兼容torch<1.9.0的缺失take_along_dim,修复bart中位置向量514的问题,修复Sptokenizer对符号不转换,打印Epoch开始的时间戳,增加parallel_apply

bert4torch - 稳定版本v0.1.9

Published by Tongjilibo about 2 years ago

bert4torch - 稳定版本v0.1.8

Published by Tongjilibo over 2 years ago

v0.1.8版本,修复了crf,xlnet等bug,目前测下来是稳定版本

Package Rankings
Top 6.7% on Proxy.golang.org
Top 7.41% on Pypi.org
Badges
Extracted from project README
licence GitHub release PyPI PyPI - Downloads GitHub stars GitHub Issues contributions welcome Generic badge