Florence-2-FT-DocVQA / check_config.py
mynkchaudhry's picture
configuration is properly serialized
5f26407 verified
raw
history blame contribute delete
467 Bytes
import json
from transformers import AutoConfig
class Florence2Config(AutoConfig):
def to_dict(self):
# Convert the configuration to a dictionary format that can be serialized
config_dict = super().to_dict()
# Handle any custom attributes if needed
return config_dict
# Use the custom configuration class
config = Florence2Config.from_pretrained("mynkchaudhry/Florence-2-FT-DocVQA")
print(json.dumps(config.to_dict(), indent=2))