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.

SafeLLamaContextHandle.cs 545 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.InteropServices;
  4. using System.Text;
  5. namespace LLama.Native
  6. {
  7. public class SafeLLamaContextHandle: SafeLLamaHandleBase
  8. {
  9. protected SafeLLamaContextHandle()
  10. {
  11. }
  12. public SafeLLamaContextHandle(IntPtr handle)
  13. : base(handle)
  14. {
  15. }
  16. protected override bool ReleaseHandle()
  17. {
  18. NativeApi.llama_free(handle);
  19. SetHandle(IntPtr.Zero);
  20. return true;
  21. }
  22. }
  23. }

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