TypeError: Object of type ListConfig is not JSON serializable

I’m encountering an error while working with the peft package. The error occurs when trying to save the pretrained model using the save_pretrained method. Here’s the traceback:

File "/pubhome/bozhang/anaconda3/envs/protein_design/lib/python3.8/site-packages/peft/peft_model.py", line 283, in save_pretrained
    peft_config.save_pretrained(output_dir, auto_mapping_dict=auto_mapping_dict)
  File "/pubhome/bozhang/anaconda3/envs/protein_design/lib/python3.8/site-packages/peft/config.py", line 80, in save_pretrained
    writer.write(json.dumps(output_dict, indent=2, sort_keys=True))
  File "/pubhome/bozhang/anaconda3/envs/protein_design/lib/python3.8/json/__init__.py", line 234, in dumps
    return cls(
  File "/pubhome/bozhang/anaconda3/envs/protein_design/lib/python3.8/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/pubhome/bozhang/anaconda3/envs/protein_design/lib/python3.8/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/pubhome/bozhang/anaconda3/envs/protein_design/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/pubhome/bozhang/anaconda3/envs/protein_design/lib/python3.8/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/pubhome/bozhang/anaconda3/envs/protein_design/lib/python3.8/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type ListConfig is not JSON serializable

It seems that there’s an issue with JSON serialization of the ListConfig object in the peft package. Can someone provide guidance on how to resolve this issue? Any help would be greatly appreciated. Thank you!