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.

text-to-text-apis.md 879 B

123456789101112131415161718
  1. # Text-to-Text APIs of the executors
  2. All the executors implements the interface `ILLamaExecutor`, which provides two APIs to execute text-to-text tasks.
  3. ```cs
  4. public interface ILLamaExecutor
  5. {
  6. public LLamaModel Model { get; }
  7. IEnumerable<string> Infer(string text, InferenceParams? inferenceParams = null, CancellationToken token = default);
  8. IAsyncEnumerable<string> InferAsync(string text, InferenceParams? inferenceParams = null, CancellationToken token = default);
  9. }
  10. ```
  11. Just pass the text to the executor with the inference parameters. For the inference parameters, please refer to [executor inference parameters doc](./parameters.md).
  12. The output of both two APIs are **yield enumerable**. Therefore, when receiving the output, you can directly use `foreach` to take actions on each word you get by order, instead of waiting for the whole process completed.

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