@@ -36,22 +36,76 @@ impl crate::Config {
3636
3737 pub fn jina_clip ( ) -> Self {
3838 Self :: default ( )
39- . with_name ( "jina-clip-v1" )
4039 . with_batch_size_all ( 1 )
4140 . with_visual_ixx ( 0 , 1 , 3 . into ( ) )
4241 . with_visual_ixx ( 0 , 2 , 224 . into ( ) )
4342 . with_visual_ixx ( 0 , 3 , 224 . into ( ) )
4443 . with_image_mean ( & [ 0.48145466 , 0.4578275 , 0.40821073 ] )
4544 . with_image_std ( & [ 0.26862954 , 0.2613026 , 0.2757771 ] )
45+ . with_visual_file ( "visual.onnx" )
46+ . with_textual_file ( "textual.onnx" )
47+ }
48+
49+ pub fn jina_clip_v1 ( ) -> Self {
50+ Self :: jina_clip ( )
51+ . with_name ( "jina-clip-v1" )
4652 . with_tokenizer_file ( "jina-clip-v1/tokenizer.json" )
4753 . with_tokenizer_config_file ( "jina-clip-v1/tokenizer_config.json" )
4854 . with_special_tokens_map_file ( "jina-clip-v1/special_tokens_map.json" )
4955 . with_config_file ( "jina-clip-v1/config.json" )
5056 }
5157
52- pub fn jina_clip_v1 ( ) -> Self {
58+ pub fn jina_clip_v2 ( ) -> Self {
5359 Self :: jina_clip ( )
54- . with_visual_file ( "visual.onnx" )
55- . with_textual_file ( "textual.onnx" )
60+ . with_name ( "jina-clip-v2" )
61+ . with_visual_ixx ( 0 , 2 , 512 . into ( ) )
62+ . with_visual_ixx ( 0 , 3 , 512 . into ( ) )
63+ . with_tokenizer_file ( "jina-clip-v2/tokenizer.json" )
64+ . with_tokenizer_config_file ( "jina-clip-v2/tokenizer_config.json" )
65+ . with_special_tokens_map_file ( "jina-clip-v2/special_tokens_map.json" )
66+ . with_config_file ( "jina-clip-v2/config.json" )
67+ }
68+
69+ pub fn mobileclip ( ) -> Self {
70+ Self :: default ( )
71+ . with_name ( "mobileclip" )
72+ . with_batch_size_all ( 1 )
73+ . with_visual_ixx ( 0 , 1 , 3 . into ( ) )
74+ . with_visual_ixx ( 0 , 2 , 224 . into ( ) )
75+ . with_visual_ixx ( 0 , 3 , 224 . into ( ) )
76+ . with_model_max_length ( 77 )
77+ . with_tokenizer_file ( "clip/tokenizer.json" )
78+ . with_tokenizer_config_file ( "clip/tokenizer_config.json" )
79+ . with_special_tokens_map_file ( "clip/special_tokens_map.json" )
80+ }
81+
82+ pub fn mobileclip_s0 ( ) -> Self {
83+ Self :: mobileclip ( )
84+ . with_textual_file ( "s0-textual.onnx" )
85+ . with_visual_file ( "s0-visual.onnx" )
86+ }
87+
88+ pub fn mobileclip_s1 ( ) -> Self {
89+ Self :: mobileclip ( )
90+ . with_textual_file ( "s1-textual.onnx" )
91+ . with_visual_file ( "s1-visual.onnx" )
92+ }
93+
94+ pub fn mobileclip_s2 ( ) -> Self {
95+ Self :: mobileclip ( )
96+ . with_textual_file ( "s2-textual.onnx" )
97+ . with_visual_file ( "s2-visual.onnx" )
98+ }
99+
100+ pub fn mobileclip_b ( ) -> Self {
101+ Self :: mobileclip ( )
102+ . with_textual_file ( "b-textual.onnx" )
103+ . with_visual_file ( "b-visual.onnx" )
104+ }
105+
106+ pub fn mobileclip_blt ( ) -> Self {
107+ Self :: mobileclip ( )
108+ . with_textual_file ( "blt-textual.onnx" )
109+ . with_visual_file ( "blt-visual.onnx" )
56110 }
57111}
0 commit comments