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.

ILLamaExecutor.cs 1.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Collections.Generic;
  2. using System.Threading;
  3. namespace LLama.Abstractions
  4. {
  5. /// <summary>
  6. /// A high level interface for LLama models.
  7. /// </summary>
  8. public interface ILLamaExecutor
  9. {
  10. /// <summary>
  11. /// The loaded context for this executor.
  12. /// </summary>
  13. public LLamaContext Context { get; }
  14. // LLava Section
  15. //
  16. /// <summary>
  17. /// Identify if it's a multi-modal model and there is a image to process.
  18. /// </summary>
  19. public bool IsMultiModal { get; }
  20. /// <summary>
  21. /// Muti-Modal Projections / Clip Model weights
  22. /// </summary>
  23. public LLavaWeights? ClipModel { get; }
  24. /// <summary>
  25. /// List of images: List of images in byte array format.
  26. /// </summary>
  27. public List<byte[]> Images { get; }
  28. /// <summary>
  29. /// Asynchronously infers a response from the model.
  30. /// </summary>
  31. /// <param name="text">Your prompt</param>
  32. /// <param name="inferenceParams">Any additional parameters</param>
  33. /// <param name="token">A cancellation token.</param>
  34. /// <returns></returns>
  35. IAsyncEnumerable<string> InferAsync(string text, IInferenceParams? inferenceParams = null, CancellationToken token = default);
  36. }
  37. }