55Keys are the names of repositories with models.
66"""
77model_hash_dict = dict (
8- txtlayer_classifier = "94e27e184fa2876883d260e0aa58b042e6ab3e35 " ,
8+ txtlayer_classifier = "9ca1de749d8d37147b00a3a228e03ee1776c695f " ,
99 scan_orientation_efficient_net_b0 = "9ea283f3d346ae4fdd82463a9f60b5369a3ffb58" ,
1010 font_classifier = "db4481ad60ab050cbb42079b64f97f9e431feb07" ,
11- paragraph_classifier = "00bf989876cec171c1cf9859a6b712af6445e864 " ,
12- line_type_classifiers = "2e498d1ec82b72c1a96ba0d25344b71402997013 " ,
13- fintoc_classifiers = "42f8ada99a5da608139b078c93bebfffc5b30263 "
11+ paragraph_classifier = "c26a10193499d3cbc77ffec9842bece24fa8950b " ,
12+ line_type_classifiers = "0568c6e1f49612c0c351f10b80a26dc05f796683 " ,
13+ fintoc_classifiers = "6a907b7d2437c3f61ac9c506f67175207982fae8 "
1414)
1515
1616
@@ -27,29 +27,29 @@ def download_from_hub(out_dir: str, out_name: str, repo_name: str, hub_name: str
2727def download (resources_path : str ) -> None :
2828 import os
2929
30- download_from_hub (out_dir = resources_path , out_name = "txtlayer_classifier.pkl.gz " , repo_name = "txtlayer_classifier" , hub_name = "model.pkl.gz " )
30+ download_from_hub (out_dir = resources_path , out_name = "txtlayer_classifier.json " , repo_name = "txtlayer_classifier" , hub_name = "model.json " )
3131
3232 download_from_hub (out_dir = resources_path ,
3333 out_name = "scan_orientation_efficient_net_b0.pth" ,
3434 repo_name = "scan_orientation_efficient_net_b0" ,
3535 hub_name = "model.pth" )
3636
37- download_from_hub (out_dir = resources_path , out_name = "paragraph_classifier.pkl.gz " , repo_name = "paragraph_classifier" , hub_name = "model.pkl.gz " )
37+ download_from_hub (out_dir = resources_path , out_name = "paragraph_classifier.zip " , repo_name = "paragraph_classifier" , hub_name = "model.zip " )
3838
3939 line_clf_resources_path = os .path .join (resources_path , "line_type_classifiers" )
4040 for classifier_type in ("diploma" , "law" , "law_txt" , "tz" , "tz_txt" ):
4141 download_from_hub (out_dir = line_clf_resources_path ,
42- out_name = f"{ classifier_type } _classifier.pkl.gz " ,
42+ out_name = f"{ classifier_type } _classifier.zip " ,
4343 repo_name = "line_type_classifiers" ,
44- hub_name = f"{ classifier_type } .pkl.gz " )
44+ hub_name = f"{ classifier_type } .zip " )
4545
4646 fintoc_classifiers_resources_path = os .path .join (resources_path , "fintoc_classifiers" )
4747 for language in ("en" , "fr" , "sp" ):
4848 for classifier_type in ("target" , "binary" ):
4949 download_from_hub (out_dir = fintoc_classifiers_resources_path ,
50- out_name = f"{ classifier_type } _classifier_{ language } .pkg.gz " ,
50+ out_name = f"{ classifier_type } _classifier_{ language } .json " ,
5151 repo_name = "fintoc_classifiers" ,
52- hub_name = f"{ classifier_type } _classifier_{ language } _txt_layer.pkg.gz " )
52+ hub_name = f"{ classifier_type } _classifier_{ language } _txt_layer.json " )
5353
5454
5555if __name__ == "__main__" :
0 commit comments