Merge branch 'master' of https://github.com/liuwei-git/llama.cpp
This commit is contained in:
commit
725afbcf52
1 changed files with 24 additions and 1 deletions
|
@ -2885,6 +2885,29 @@ def main() -> None:
|
|||
|
||||
print(f"Model successfully exported to '{fname_out}'")
|
||||
|
||||
def main_dbg():
|
||||
dir_model = Path("d:/models/phi3")
|
||||
fname_out = Path("c:/models/phi3_fp16.gguf")
|
||||
|
||||
print(f"Loading model: {dir_model.name}")
|
||||
|
||||
hparams = Model.load_hparams(dir_model)
|
||||
|
||||
with torch.inference_mode():
|
||||
model_class = Model.from_model_architecture(hparams["architectures"][0])
|
||||
model_instance = model_class(dir_model, gguf.GGMLQuantizationType.F16, fname_out, None)
|
||||
|
||||
print("Set model parameters")
|
||||
model_instance.set_gguf_parameters()
|
||||
|
||||
print("Set model tokenizer")
|
||||
model_instance.set_vocab()
|
||||
|
||||
print(f"Exporting model to '{fname_out}'")
|
||||
model_instance.write()
|
||||
|
||||
print(f"Model successfully exported to '{fname_out}'")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main_dbg()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue