Update.md

January 14, 2026 · View on GitHub

版本历史

更新日期bert4torch版本torch4keras版本版本说明
202601140.6.10.3.3增加 Qwen3-moe, 支持 gptqawq等主流量化方式,其他代码优化
202509250.6.00.3.2增加 Qwen3-moe, 支持 gptqawq等主流量化方式,其他代码优化
202507210.5.9.post20.3.1增加 Ernie4_5, 修复hub下载bug, 拆分出 openai_client
202506210.5.80.3.0增加 Qwen3-EmbeddingQwen3-Reranker, 支持 temperature设置为0, 修复 sdpaglobal_point的bug, 拆分 attention_utils
202505110.5.70.2.9.post2命令行参数修改为 bert4torch serve, 增加 Qwen3
202504010.5.60.2.9命令行支持图片输入, 修复rope在batch推理和超长时候的bug
202502150.5.50.2.8增加 deepseek-r1, internvl, internlm3, glm4v, modernbert, mllama, qwen2vl, qwenvl
202409280.5.40.2.7【新功能】增加deepseek系列、MiniCPM、MiniCPMV、llama3.2、Qwen2.5;支持device_map=auto;【修复】修复batch_generate和n>1的bug
202408140.5.30.2.6【新功能】增加llama3.1/Yi1.5;自动选择从hfmirror下载;支持命令行参数bert4torch serve
202408010.5.20.2.5【新功能】chatglm/qwen系列支持function call调用, 增加internlm2系列;【小优化】简化pipeline中chat demo的调用,generate的终止token元素允许为列表, 统一rope_scaling参数名,增加rope衍生类;【bug】修复flash_attn2的推理bug, 修复bart的tie_word_embedding的bug
202406190.5.10.2.4增加Qwen1.5, Qwen2, glm4; 增加SWA/convert_logits_dtype;调整各个trainer(重点DPOTrainer), generation中segment_ids, repetition_penalty需带query, RMSNorm中转类型bug
202404180.5.00.2.2修复chatglm3的bug, 修复save_pretrained时多文件的bug,增加CausalLMLoss, 修改deepspeed的传参逻辑,修改Text2Vec的bug, 完善openai client, 增加get_weight_decay_optim_groups
202403170.4.9.post20.2.1.post2增加get_weight_decay_optim_groups函数, attention中允许is_causal,修改repetition_penalty的bug,把baichuan从llama中剥离,修复config_path的bug,允许num_key_value_heads参数,torch4keras-v0.2.1.post2更新特性
202402210.4.80.2.0fastapi发布服务允许闲时offload到cpu, build_transformer_model允许从hf下载, 添加FillMask的pipeline, 添加SequenceClassificationTrainer
202402040.4.70.1.9修改save_pretrained用于保存文件夹, 增加GenerateSpeed用于统计token生成速度,修复t5在use_states=True时候的错误, 修改层次编码的bug, 增加deepseek_moe模型,修复generation并发错误,优化大模型耗时
202401160.4.60.1.8bug修复,增加save_pretrained用于保存transformer格式的权重, 增加部分embedding模型
202401110.4.50.1.7training时候不生成past_key_values, 增加streamlit的example, 修复句向量max时的bug, batch_generate合并到generate, 修改generation的默认参数名(兼容过去的参数名), 多轮对话中可保留past_key_values, 把attention中的mask补齐逻辑移到apply_embedding中, 增加uiepipeline,增加PtuningV2Trainer
202312280.4.40.1.7新增pipelines模块,把chat整理进去,并新增Text2Vec模块用于向量生成,新增snapshot_download用于hf模型下载
202312240.4.30.1.7chat中增加常见chat模型, 简化大模型调用的代码逻辑
202312190.4.20.1.7参数checkpoint_path支持传入文件夹地址,增加chat模块用于快速发布demo/api, 支持加载.safetensors, meta的device提示报错
202312100.4.10.1.6.post2增加longlora, 增加test模块,适配torch4keras==0.1.6(监控fit过程,有报错则发送邮件提醒; 解决torch2.0的compile冲突问题; 修复clip_grad_norm的bug)
202311260.4.00.1.5修复flash_attn的bug, stream_generate支持仅输出last_token
202311190.3.90.1.5修复random_sample采样n>1, 新增Yi-6B, 支持flash_attn
202311120.3.80.1.5支持chatglm 32k的rope_ratio,config中可以指定mapping, 增加m3e和bge
202311060.3.70.1.5大部分模型文件无需convert,修复multi_query_group_num在int4/int8下bug, 简化build_transformer_model中配置到config
202310220.3.60.1.5增加falcon,layernorm支持torch自带
202309120.3.5.post20.1.4.post2修复generation(既可初始化传参,也可以generate传参),decoder架构、encoder-decoder架构的增加generate系列方法直接推理, 增加internlm/baichuan2模型,训练时会默认自动把dataloader转移到model.device上, 增加xformers
202309020.3.40.1.3修复gradient_checkpoint在低版本torch时仅支持位置参数的问题, 增加trainer.py, 增加PPOTrainerTrl以及相应的三阶段rlhf训练+dpo训练
202308120.3.30.1.2增加大模型deepspeed的使用,增加Qwen模型(增加ntk和logn_attn),generation的end_id支持多个token_id,修复多文件权重加载资源占用问题
202308040.3.20.1.1修改依赖的torch4keras, 主要是进度条和logger, tensorboard的同步
202307260.3.1.post20.1.0.post2修改baichuan的alibi逻辑,增加bloom, 简化decoder架构代码(gpt, llama, chatglm均继承decoder)
202307160.3.00.0.9修改models和layers为文件夹方便扩展, 增加flash_attention参数控制,修改skip_init逻辑减少显存占用,generation增加repetition_penalty,修复chatglm的pv2的bug,generation支持transformers的tokenize,增加ziya,Baichuan
202307050.2.90.0.8使用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微调
202305180.2.80.0.7.post31)新增模型: 增加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;
2)generation: 生成式解码新增SeqGeneration和Seq2SeqGeneration,单向decoder模型和encoder decoder模型解码增加cache, 增加batch_generate()/stream_generate功能;
3)其他: 修改rope为不使用max_position,修复model.half()类型不一致问题,支持加载多个权重文件, gpt系列默认不加softmax,增加苏神Tiger的pytorch实现, 增加了对attention_key_size的入参支持,把_token_pad_ids重命名为pad_token_ids, tokenizor中重命名部分字段
202303100.2.7.post20.0.6增加lion优化器, 修复albert_unshared加载权重, 修复lm系列(gpt, seq2seq)存在的forward参数不对的问题,修复GlobalPointer使用rope的bug
202302130.2.70.0.6修复random_sample()的bug,适配v0.0.6的torch4keras:增加resume_from_checkpoint和save_to_checkpoint;增加add_trainer方法,重构了Trainer(BaseModel)的实现,增加了AccelerateCallback
202212310.2.60.0.5build_transformer_model需显式指定add_trainer才从BaseModel继承, 增加guwenbert, macbert,text2vec-bert-chinese, wobert预训练模型,允许position_ids从padding开始, transformer.config支持点操作,可以使用torch4keras的Trainer(net)来初始化, 修复tokenizer的切分subtoken的bug, 允许embedding_size!=hidden_size
202211270.2.50.0.4对抗训练从compile转为使用Callback来实现,修复1.7.1版本兼容bug, uie模型内置
202211200.2.40.0.3.post2删除SpTokenizer基类中的rematch, 增加deberta_v2模型
202210230.2.30.0.2虚拟对抗VAT在多个ouput时支持指定,把Trainer抽象到torch4keras中,修复DP和DDP出现resume_epoch不存在的bug, tokenizer的never_split去除None, transformer_xl的bug, 增加gradient_checkpoint
202209220.2.2——修复t5的norm_mode问题,允许hidden_size不整除num_attention_heads,支持多个schedule(如同时ema+warmup)
202209050.2.1——兼容torch<=1.7.1的torch.div无rounding_mode,增加自定义metrics,支持断点续训,增加默认Logger和Tensorboard日志
202208230.2.0——兼容torch1.9.0的缺失take_along_dim,修复bart中位置向量514的问题,修复Sptokenizer对符号不转换,打印Epoch开始的时间戳,增加parallel_apply
202208080.1.9——增加mixup/manifold_mixup/temporal_ensembling策略,修复pgd策略param.grad为空的问题,修改tokenizer支持批量
202207170.1.8——修复原来CRF训练中loss陡增的问题,修复xlnet的token_type_ids输入显存占用大的问题
202207100.1.7——增加EarlyStop,CRF中自带转bool类型
202206050.1.6——增加transformer_xl、xlnet、t5_pegasus模型,prompt、预训练等示例,支持增加embedding输入,EMA策略,修复tokenizer和sinusoid的bug
202205040.1.5——增加GAU-alpha,混合梯度,梯度裁剪,单机多卡(DP、DDP)
202204210.1.4——增加了VAT,修复了linux下apply_embedding返回项有问题的情况
202204090.1.3——初始版本