You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

save-load-state.md 610 B

12345678910111213141516171819
  1. # Save/Load State
  2. There're two ways to load state: loading from path and loading from bite array. Therefore, correspondingly, state data can be extracted as byte array or saved to a file.
  3. ```cs
  4. LLamaModel model = new LLamaModel(new ModelParams("<modelPath>"));
  5. // do some things...
  6. model.SaveState("model.st");
  7. var stateData = model.GetStateData();
  8. model.Dispose();
  9. LLamaModel model2 = new LLamaModel(new ModelParams("<modelPath>"));
  10. model2.LoadState(stateData);
  11. // do some things...
  12. LLamaModel model3 = new LLamaModel(new ModelParams("<modelPath>"));
  13. model3.LoadState("model.st");
  14. // do some things...
  15. ```

C#/.NET上易用的LLM高性能推理框架,支持LLaMA和LLaVA系列模型。