ModelSamplingParams Class
- java.
lang. Object - com.
azure. ai. projects. models. ModelSamplingParams
- com.
Implements
public final class ModelSamplingParams
implements JsonSerializable<ModelSamplingParams>
Represents a set of parameters used to control the sampling behavior of a language model during text generation.
Constructor Summary
| Constructor | Description |
|---|---|
| ModelSamplingParams() |
Creates an instance of Model |
| ModelSamplingParams(double temperature, double topP, int seed, int maxCompletionTokens) |
Creates an instance of Model |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Model |
fromJson(JsonReader jsonReader)
Reads an instance of Model |
| Integer |
getMaxCompletionTokens()
Get the max |
| Integer |
getSeed()
Get the seed property: The random seed for reproducibility. |
| Double |
getTemperature()
Get the temperature property: The temperature parameter for sampling. |
| Double |
getTopP()
Get the topP property: The top-p parameter for nucleus sampling. |
|
Model |
setMaxCompletionTokens(Integer maxCompletionTokens)
Set the max |
|
Model |
setSeed(Integer seed)
Set the seed property: The random seed for reproducibility. |
|
Model |
setTemperature(Double temperature)
Set the temperature property: The temperature parameter for sampling. |
|
Model |
setTopP(Double topP)
Set the topP property: The top-p parameter for nucleus sampling. |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from java.lang.Object
Constructor Details
ModelSamplingParams
public ModelSamplingParams()
Creates an instance of ModelSamplingParams class.
ModelSamplingParams
public ModelSamplingParams(double temperature, double topP, int seed, int maxCompletionTokens)
Creates an instance of ModelSamplingParams class.
Parameters:
Method Details
fromJson
public static ModelSamplingParams fromJson(JsonReader jsonReader)
Reads an instance of ModelSamplingParams from the JsonReader.
Parameters:
Returns:
Throws:
getMaxCompletionTokens
public Integer getMaxCompletionTokens()
Get the maxCompletionTokens property: The maximum number of tokens allowed in the completion.
Returns:
getSeed
public Integer getSeed()
Get the seed property: The random seed for reproducibility. Defaults to 42.
Returns:
getTemperature
public Double getTemperature()
Get the temperature property: The temperature parameter for sampling. Defaults to 1.0.
Returns:
getTopP
public Double getTopP()
Get the topP property: The top-p parameter for nucleus sampling. Defaults to 1.0.
Returns:
setMaxCompletionTokens
public ModelSamplingParams setMaxCompletionTokens(Integer maxCompletionTokens)
Set the maxCompletionTokens property: The maximum number of tokens allowed in the completion.
Parameters:
Returns:
setSeed
public ModelSamplingParams setSeed(Integer seed)
Set the seed property: The random seed for reproducibility. Defaults to 42.
Parameters:
Returns:
setTemperature
public ModelSamplingParams setTemperature(Double temperature)
Set the temperature property: The temperature parameter for sampling. Defaults to 1.0.
Parameters:
Returns:
setTopP
public ModelSamplingParams setTopP(Double topP)
Set the topP property: The top-p parameter for nucleus sampling. Defaults to 1.0.
Parameters:
Returns: