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)) | |