|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- # GreedySamplingPipeline
-
- Namespace: LLama.Sampling
-
- A sampling pipeline which always selects the most likely token
-
- ```csharp
- public class GreedySamplingPipeline : BaseSamplingPipeline, ISamplingPipeline, System.IDisposable
- ```
-
- Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [BaseSamplingPipeline](./llama.sampling.basesamplingpipeline.md) → [GreedySamplingPipeline](./llama.sampling.greedysamplingpipeline.md)<br>
- Implements [ISamplingPipeline](./llama.sampling.isamplingpipeline.md), [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable)
-
- ## Properties
-
- ### **Grammar**
-
- Grammar to constrain valid tokens
-
- ```csharp
- public SafeLLamaGrammarHandle Grammar { get; set; }
- ```
-
- #### Property Value
-
- [SafeLLamaGrammarHandle](./llama.native.safellamagrammarhandle.md)<br>
-
- ## Constructors
-
- ### **GreedySamplingPipeline()**
-
- ```csharp
- public GreedySamplingPipeline()
- ```
-
- ## Methods
-
- ### **ProcessLogits(SafeLLamaContextHandle, Span<Single>, ReadOnlySpan<LLamaToken>)**
-
- ```csharp
- protected void ProcessLogits(SafeLLamaContextHandle ctx, Span<float> logits, ReadOnlySpan<LLamaToken> lastTokens)
- ```
-
- #### Parameters
-
- `ctx` [SafeLLamaContextHandle](./llama.native.safellamacontexthandle.md)<br>
-
- `logits` [Span<Single>](https://docs.microsoft.com/en-us/dotnet/api/system.span-1)<br>
-
- `lastTokens` [ReadOnlySpan<LLamaToken>](https://docs.microsoft.com/en-us/dotnet/api/system.readonlyspan-1)<br>
-
- ### **ProcessTokenDataArray(SafeLLamaContextHandle, LLamaTokenDataArray, ReadOnlySpan<LLamaToken>)**
-
- ```csharp
- protected LLamaToken ProcessTokenDataArray(SafeLLamaContextHandle ctx, LLamaTokenDataArray candidates, ReadOnlySpan<LLamaToken> lastTokens)
- ```
-
- #### Parameters
-
- `ctx` [SafeLLamaContextHandle](./llama.native.safellamacontexthandle.md)<br>
-
- `candidates` [LLamaTokenDataArray](./llama.native.llamatokendataarray.md)<br>
-
- `lastTokens` [ReadOnlySpan<LLamaToken>](https://docs.microsoft.com/en-us/dotnet/api/system.readonlyspan-1)<br>
-
- #### Returns
-
- [LLamaToken](./llama.native.llamatoken.md)<br>
-
- ### **Clone()**
-
- ```csharp
- public ISamplingPipeline Clone()
- ```
-
- #### Returns
-
- [ISamplingPipeline](./llama.sampling.isamplingpipeline.md)<br>
|