forked from sandrohanea/whisper.net
-
Notifications
You must be signed in to change notification settings - Fork 1
/
GreedySamplingStrategyBuilder.cs
36 lines (30 loc) · 1.15 KB
/
GreedySamplingStrategyBuilder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Licensed under the MIT license: https://opensource.org/licenses/MIT
using Whisper.net.SamplingStrategy;
namespace Whisper.net;
/// <summary>
/// Builder for <seealso cref="GreedySamplingStrategyBuilder"/>
/// </summary>
public class GreedySamplingStrategyBuilder : IWhisperSamplingStrategyBuilder
{
private readonly GreedySamplingStrategy greedySamplingStrategy;
internal GreedySamplingStrategyBuilder(WhisperProcessorBuilder parentBuilder, GreedySamplingStrategy greedySamplingStrategy)
{
ParentBuilder = parentBuilder;
this.greedySamplingStrategy = greedySamplingStrategy;
}
/// <inheritdoc/>
public WhisperProcessorBuilder ParentBuilder { get; }
/// <summary>
/// Configures the Greedy Sampling Strategy with the specified <paramref name="bestOf"/>.
/// </summary>
/// <param name="bestOf">The best of to be used</param>
/// <returns>An instance to the same builder.</returns>
/// <remarks>
/// If not configured, 1 decoder is used.
/// </remarks>
public GreedySamplingStrategyBuilder WithBestOf(int bestOf)
{
greedySamplingStrategy.BestOf = bestOf;
return this;
}
}