mynkchaudhry
commited on
Commit
•
5f26407
1
Parent(s):
42e5949
configuration is properly serialized
Browse files- check_config.py +13 -0
check_config.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
from transformers import AutoConfig
|
3 |
+
|
4 |
+
class Florence2Config(AutoConfig):
|
5 |
+
def to_dict(self):
|
6 |
+
# Convert the configuration to a dictionary format that can be serialized
|
7 |
+
config_dict = super().to_dict()
|
8 |
+
# Handle any custom attributes if needed
|
9 |
+
return config_dict
|
10 |
+
|
11 |
+
# Use the custom configuration class
|
12 |
+
config = Florence2Config.from_pretrained("mynkchaudhry/Florence-2-FT-DocVQA")
|
13 |
+
print(json.dumps(config.to_dict(), indent=2))
|