File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ def main(args):
8888 else :
8989 raise ValueError ()
9090
91+ local_model = False
92+ model_path = ""
9193 model_name = args .model_name
9294 print ("model_name: " , model_name )
9395 qwen2vl = Qwen2VLForConditionalGeneration .from_pretrained (
@@ -97,8 +99,10 @@ def main(args):
9799 vcfg = cfg .vision_config
98100
99101 if os .path .isdir (model_name ):
102+ local_model = True
100103 if model_name .endswith (os .sep ):
101104 model_name = model_name [:- 1 ]
105+ model_path = model_name
102106 model_name = os .path .basename (model_name )
103107 fname_out = f"{ model_name .replace ('/' , '-' ).lower ()} -vision.gguf"
104108
@@ -139,7 +143,10 @@ def main(args):
139143 it will be hardcoded in the `clip_image_build_graph` from `clip.cpp`.
140144 """
141145
142- processor : Qwen2VLProcessor = AutoProcessor .from_pretrained (model_name )
146+ if local_model :
147+ processor : Qwen2VLProcessor = AutoProcessor .from_pretrained (model_path )
148+ else :
149+ processor : Qwen2VLProcessor = AutoProcessor .from_pretrained (model_name )
143150 fout .add_array ("clip.vision.image_mean" , processor .image_processor .image_mean ) # type: ignore[reportAttributeAccessIssue]
144151 fout .add_array ("clip.vision.image_std" , processor .image_processor .image_std ) # type: ignore[reportAttributeAccessIssue]
145152
You can’t perform that action at this time.
0 commit comments