Skip to content

The model's name is saved as model.safetensors while the logger reported its name as pytorch_model.bin, which is quite weird. #28076

Description

@izyForever

System Info

  • transformers version: 4.36.1
  • Platform: Windows-10-10.0.19045-SP0
  • Python version: 3.11.2
  • Huggingface_hub version: 0.19.4
  • Safetensors version: 0.4.0
  • Accelerate version: 0.25.0
  • Accelerate config: not found
  • PyTorch version (GPU?): 2.1.1+cu118 (True)
  • Tensorflow version (GPU?): not installed (NA)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using GPU in script?:
  • Using distributed or parallel set-up in script?:

Who can help?

9ZZRLD04)PX107 _N7IV5 X

_3G(V3TRGTN3T)%_{5({3

When I was training my model, I finded there was not pytorch_model.bin but model.safetensors,
I think it's misguided in some ways.

The logger is below:

1JFOSY7B06_A8E_6QHIVDMQ
5}Y_LT} Y7)4T YE~ATH@SR
H{ XW2%LB~P_COT`} 0D{B7

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

  1. use the p-tuning script to fine tuning chatglm2-6b
  2. In Windows 10, I use bat to run the script, as below, which works well but inconsistent logger.
set PRE_SEQ_LEN=128
set LR=2e-2

python main.py ^
    --do_train ^
    --train_file AdvertiseGen/train.json ^
    --validation_file AdvertiseGen/dev.json ^
    --preprocessing_num_workers 10 ^
    --prompt_column content ^
    --response_column summary ^
    --overwrite_cache ^
    --model_name_or_path  E://ChatGLM2-6B ^
    --output_dir output/adgen-chatglm2-6b-pt-%PRE_SEQ_LEN%-%LR% ^
    --overwrite_output_dir ^
    --max_source_length 64 ^
    --max_target_length 128 ^
    --per_device_train_batch_size 1 ^
    --per_device_eval_batch_size 1 ^
    --gradient_accumulation_steps 16 ^
    --predict_with_generate ^
    --max_steps 3 ^
    --logging_steps 1 ^
    --save_steps 1 ^
    --learning_rate %LR% ^
    --pre_seq_len %PRE_SEQ_LEN% ^
    --quantization_bit 4

Expected behavior

I think it will be better if the file name is the same as the logger shows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions