Save Hugging Face Model with One Bin
作者:XD / 发表: 2023年8月7日 02:41 / 更新: 2023年8月7日 02:41 / 编程笔记 / 阅读量:871
max_shard_size (int or str, optional, defaults to "10GB") — Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size lower than this size. If expressed as a string, needs to be digits followed by a unit (like "5MB").
Based on the introduction, one bin model can be saved by changing the "max_shard_size".
LlamaForCausalLM.save_pretrained(base_model, output_dir, max_shard_size="100GB") # save one bin if the model is less than 100GB
Reference
相关标签