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.

llama.statelessexecutor.md 2.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # StatelessExecutor
  2. Namespace: LLama
  3. This executor infer the input as one-time job. Previous inputs won't impact on the
  4. response to current input.
  5. ```csharp
  6. public class StatelessExecutor : LLama.Abstractions.ILLamaExecutor
  7. ```
  8. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [StatelessExecutor](./llama.statelessexecutor.md)<br>
  9. Implements [ILLamaExecutor](./llama.abstractions.illamaexecutor.md)
  10. ## Properties
  11. ### **Context**
  12. The context used by the executor when running the inference.
  13. ```csharp
  14. public LLamaContext Context { get; private set; }
  15. ```
  16. #### Property Value
  17. [LLamaContext](./llama.llamacontext.md)<br>
  18. ## Constructors
  19. ### **StatelessExecutor(LLamaWeights, IModelParams)**
  20. Create a new stateless executor which will use the given model
  21. ```csharp
  22. public StatelessExecutor(LLamaWeights weights, IModelParams params)
  23. ```
  24. #### Parameters
  25. `weights` [LLamaWeights](./llama.llamaweights.md)<br>
  26. `params` [IModelParams](./llama.abstractions.imodelparams.md)<br>
  27. ### **StatelessExecutor(LLamaContext)**
  28. #### Caution
  29. Use the constructor which automatically creates contexts using the LLamaWeights
  30. ---
  31. Create a new stateless executor which will use the model used to create the given context
  32. ```csharp
  33. public StatelessExecutor(LLamaContext context)
  34. ```
  35. #### Parameters
  36. `context` [LLamaContext](./llama.llamacontext.md)<br>
  37. ## Methods
  38. ### **Infer(String, IInferenceParams, CancellationToken)**
  39. ```csharp
  40. public IEnumerable<string> Infer(string text, IInferenceParams inferenceParams, CancellationToken cancellationToken)
  41. ```
  42. #### Parameters
  43. `text` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  44. `inferenceParams` [IInferenceParams](./llama.abstractions.iinferenceparams.md)<br>
  45. `cancellationToken` [CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken)<br>
  46. #### Returns
  47. [IEnumerable&lt;String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
  48. ### **InferAsync(String, IInferenceParams, CancellationToken)**
  49. ```csharp
  50. public IAsyncEnumerable<string> InferAsync(string text, IInferenceParams inferenceParams, CancellationToken cancellationToken)
  51. ```
  52. #### Parameters
  53. `text` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  54. `inferenceParams` [IInferenceParams](./llama.abstractions.iinferenceparams.md)<br>
  55. `cancellationToken` [CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken)<br>
  56. #### Returns
  57. [IAsyncEnumerable&lt;String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.iasyncenumerable-1)<br>