Sample
Submits a sample operation that will asynchronously generate text completions with logprobs.
Path parameters
Training session ID
Request body
Example request
{
"model_inputs": [
{
"chunks": [
{
"encoded_text": {
"tokens": [
123,
456,
789
]
}
}
]
}
],
"sampling_params": {
"max_tokens": 512,
"temperature": 1,
"top_p": 1,
"top_k": -1,
"stop": [
"\n",
"END"
]
},
"num_samples": 1
}Response
Example response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"output": {
"results": [
{
"sequences": [
{
"tokens": [
"123",
"456",
"789"
],
"logprobs": [
-0.5,
-1.2,
-0.3
],
"prompt_cache_hit_tokens": 1024,
"routed_experts": {
"shape": [
"512",
"64",
"8"
]
}
}
],
"prompt_logprobs": [
0,
-0.5,
-1.2
],
"topk_prompt_logprobs": [
{
"token_ids": [
123,
456
],
"logprobs": [
-0.5,
-2.1
]
}
],
"policy_segments": [
{
"version": 5
}
]
}
]
},
"error": {
"message": "Operation timed out"
}
}Changes
Changed in 5 of the 15 revisions of this API.4415
- ▲
the response property
output/results/items/sequences/items/routed_experts/databecame optional for the status200response-property-became-optional
- ○
added the new optional request property
return_routed_experts_object_urinew-optional-request-property
- ○
added the optional property
output/results/items/sequences/items/routed_experts/object_urito the response with the200statusresponse-optional-property-added
- ▲
- ○
added the new optional request property
return_routed_expertsnew-optional-request-property
- ○
added the optional property
output/results/items/sequences/items/routed_expertsto the response with the200statusresponse-optional-property-added
- ○
- ●
added the new
TRAINING_OPERATION_ERROR_CODE_NON_FINITE_LOSSenum value to theerror/coderesponse property for the response status200response-property-enum-value-added
- ●
- ▲
added the new required request property
model_inputsnew-required-request-property
- ▲
removed the required property
output/rolloutsfrom the response with the200statusresponse-required-property-removed
- ●
removed the request property
promptsrequest-property-removed
- ●
removed the request property
sampling_params/return_prompt_logprobsrequest-property-removed
- ●
removed the optional property
output/policy_segmentsfrom the response with the200statusresponse-optional-property-removed
- ○
added the new optional request property
prompt_logprobsnew-optional-request-property
- ○
added the new optional request property
topk_prompt_logprobsnew-optional-request-property
- ○
added the required property
output/resultsto the response with the200statusresponse-required-property-added
This revision also has 11 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ▲
the
output/rollouts/items/sequences/items/logprobs/items/response's property type/format changed fromnumber/doubletonumber/for status200response-property-type-changed
- ○
added the new optional request property
sampling_params/return_prompt_logprobsnew-optional-request-property
- ○
the
max_tokensrequest property default value changed from100to512request-property-default-value-changed
- ○
the
num_samplesrequest property type/format was generalized frominteger/int64tointeger/request-property-type-generalized
- ○
the
sampling_params/max_tokensrequest property type/format was generalized frominteger/int32tointeger/request-property-type-generalized
- ○
the
sampling_params/temperaturerequest property type/format was generalized fromnumber/floattonumber/request-property-type-generalized
- ○
the
sampling_params/top_krequest property type/format was generalized frominteger/int32tointeger/request-property-type-generalized
- ○
the
sampling_params/top_prequest property type/format was generalized fromnumber/floattonumber/request-property-type-generalized
- ○
added the optional property
output/rollouts/items/prompt_logprobsto the response with the200statusresponse-optional-property-added
This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲