simplified the completion_probabilities
JSON schema
It's now easier to understand what the structure of `completion_probabilities` looks like.
This commit is contained in:
parent
18b612b5c6
commit
6b95a61aca
1 changed files with 17 additions and 21 deletions
|
@ -179,29 +179,25 @@ node index.js
|
||||||
* Note: When using streaming mode (`stream`) only `content` and `stop` will be returned until end of completion.
|
* Note: When using streaming mode (`stream`) only `content` and `stop` will be returned until end of completion.
|
||||||
|
|
||||||
|
|
||||||
- `completion_probabilities: List[Completion]`: A list of probabilities for each token in the completion, if available. Note the type/schema of Completion is:
|
- `completion_probabilities`: An array of token probabilities for each completion. The array's length is `n_predict`. Each item in the array has the following structure:
|
||||||
|
|
||||||
```
|
```
|
||||||
{'$defs': {'Probability': {'properties': {'prob': {'description': 'The probability of the token.',
|
{
|
||||||
'title': 'Prob',
|
"content": "<the token selected by the model>",
|
||||||
'type': 'number'},
|
"probs": [
|
||||||
'tok_str': {'description': 'The string representation of the token.',
|
{
|
||||||
'title': 'Tok Str',
|
"prob": float,
|
||||||
'type': 'string'}},
|
"tok_str": "<most likely token>"
|
||||||
'required': ['prob', 'tok_str'],
|
},
|
||||||
'title': 'Probability',
|
{
|
||||||
'type': 'object'}},
|
"prob": float,
|
||||||
'properties': {'content': {'description': 'The content associated with the probabilities.',
|
"tok_str": "<second most likely tonen>"
|
||||||
'title': 'Content',
|
},
|
||||||
'type': 'string'},
|
...
|
||||||
'probs': {'description': 'A list of probabilities for each token.',
|
]
|
||||||
'items': {'$ref': '#/$defs/Probability'},
|
},
|
||||||
'title': 'Probs',
|
```
|
||||||
'type': 'array'}},
|
Notice that each `probs` is an array of length `n_probs`.
|
||||||
'required': ['content', 'probs'],
|
|
||||||
'title': 'Completion',
|
|
||||||
'type': 'object'}
|
|
||||||
```
|
|
||||||
|
|
||||||
- `content`: Completion result as a string (excluding `stopping_word` if any). In case of streaming mode, will contain the next token as a string.
|
- `content`: Completion result as a string (excluding `stopping_word` if any). In case of streaming mode, will contain the next token as a string.
|
||||||
- `stop`: Boolean for use with `stream` to check whether the generation has stopped (Note: This is not related to stopping words array `stop` from input options)
|
- `stop`: Boolean for use with `stream` to check whether the generation has stopped (Note: This is not related to stopping words array `stop` from input options)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue