Create preprocessor_config.json
Browse files- preprocessor_config.json +10 -0
preprocessor_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import DonutProcessor
|
| 2 |
+
|
| 3 |
+
# Initialize your processor (same configuration as during training)
|
| 4 |
+
processor = DonutProcessor.from_pretrained("microsoft/trocr-base-stage1")
|
| 5 |
+
|
| 6 |
+
# Save the processor's configuration
|
| 7 |
+
processor.save_pretrained("local_processor_dir")
|
| 8 |
+
|
| 9 |
+
# Check the directory
|
| 10 |
+
print("Processor saved to:", "local_processor_dir")
|