@@ -89,6 +89,7 @@ def bytes_to_unicode():
89
89
ap = argparse .ArgumentParser ()
90
90
ap .add_argument ("-m" , "--model-dir" , help = "Path to model directory cloned from HF Hub" , required = True )
91
91
ap .add_argument ("--use-f32" , action = "store_true" , default = False , help = "Use f32 instead of f16" )
92
+ ap .add_argument ('--bigendian' , action = "store_true" , default = False , help = "Model is executed on big-endian machine" )
92
93
ap .add_argument ("--text-only" , action = "store_true" , required = False ,
93
94
help = "Save a text-only model. It can't be used to encode images" )
94
95
ap .add_argument ("--vision-only" , action = "store_true" , required = False ,
@@ -191,7 +192,7 @@ def bytes_to_unicode():
191
192
os .makedirs (output_dir , exist_ok = True )
192
193
output_prefix = os .path .basename (output_dir ).replace ("ggml_" , "" )
193
194
fname_out = os .path .join (output_dir , f"{ fname_middle } model-{ ftype_str [ftype ]} .gguf" )
194
- fout = GGUFWriter (path = fname_out , arch = "clip" )
195
+ fout = GGUFWriter (path = fname_out , arch = "clip" , endianess = GGUFEndian . LITTLE if not args . bigendian else GGUFEndian . BIG )
195
196
196
197
fout .add_bool ("clip.has_text_encoder" , has_text_encoder )
197
198
fout .add_bool ("clip.has_vision_encoder" , has_vision_encoder )
0 commit comments