File size: 467 Bytes
5f26407 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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))
|