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.interactiveexecutor.md 3.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. # InteractiveExecutor
  2. Namespace: LLama
  3. The LLama executor for interactive mode.
  4. ```csharp
  5. public class InteractiveExecutor : StatefulExecutorBase, LLama.Abstractions.ILLamaExecutor
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [StatefulExecutorBase](./llama.statefulexecutorbase.md) → [InteractiveExecutor](./llama.interactiveexecutor.md)<br>
  8. Implements [ILLamaExecutor](./llama.abstractions.illamaexecutor.md)
  9. ## Properties
  10. ### **Context**
  11. The context used by the executor.
  12. ```csharp
  13. public LLamaContext Context { get; }
  14. ```
  15. #### Property Value
  16. [LLamaContext](./llama.llamacontext.md)<br>
  17. ## Constructors
  18. ### **InteractiveExecutor(LLamaContext)**
  19. ```csharp
  20. public InteractiveExecutor(LLamaContext context)
  21. ```
  22. #### Parameters
  23. `context` [LLamaContext](./llama.llamacontext.md)<br>
  24. ## Methods
  25. ### **GetStateData()**
  26. ```csharp
  27. public ExecutorBaseState GetStateData()
  28. ```
  29. #### Returns
  30. [ExecutorBaseState](./llama.statefulexecutorbase.executorbasestate.md)<br>
  31. ### **LoadState(ExecutorBaseState)**
  32. ```csharp
  33. public void LoadState(ExecutorBaseState data)
  34. ```
  35. #### Parameters
  36. `data` [ExecutorBaseState](./llama.statefulexecutorbase.executorbasestate.md)<br>
  37. ### **SaveState(String)**
  38. ```csharp
  39. public void SaveState(string filename)
  40. ```
  41. #### Parameters
  42. `filename` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  43. ### **LoadState(String)**
  44. ```csharp
  45. public void LoadState(string filename)
  46. ```
  47. #### Parameters
  48. `filename` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  49. ### **GetLoopCondition(InferStateArgs)**
  50. Define whether to continue the loop to generate responses.
  51. ```csharp
  52. protected bool GetLoopCondition(InferStateArgs args)
  53. ```
  54. #### Parameters
  55. `args` [InferStateArgs](./llama.statefulexecutorbase.inferstateargs.md)<br>
  56. #### Returns
  57. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  58. ### **PreprocessInputs(String, InferStateArgs)**
  59. ```csharp
  60. protected void PreprocessInputs(string text, InferStateArgs args)
  61. ```
  62. #### Parameters
  63. `text` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  64. `args` [InferStateArgs](./llama.statefulexecutorbase.inferstateargs.md)<br>
  65. ### **PostProcess(IInferenceParams, InferStateArgs, IEnumerable`1&)**
  66. Return whether to break the generation.
  67. ```csharp
  68. protected bool PostProcess(IInferenceParams inferenceParams, InferStateArgs args, IEnumerable`1& extraOutputs)
  69. ```
  70. #### Parameters
  71. `inferenceParams` [IInferenceParams](./llama.abstractions.iinferenceparams.md)<br>
  72. `args` [InferStateArgs](./llama.statefulexecutorbase.inferstateargs.md)<br>
  73. `extraOutputs` [IEnumerable`1&](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1&)<br>
  74. #### Returns
  75. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  76. ### **InferInternal(IInferenceParams, InferStateArgs)**
  77. ```csharp
  78. protected void InferInternal(IInferenceParams inferenceParams, InferStateArgs args)
  79. ```
  80. #### Parameters
  81. `inferenceParams` [IInferenceParams](./llama.abstractions.iinferenceparams.md)<br>
  82. `args` [InferStateArgs](./llama.statefulexecutorbase.inferstateargs.md)<br>