Skip to content

Commit

Permalink
Clarify docs for get_output()
Browse files Browse the repository at this point in the history
  • Loading branch information
natke committed Jun 12, 2024
1 parent b5118f3 commit 511174d
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions docs/genai/api/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ Return the device type that the model has been configured to run on.
onnxruntime_genai.Model.device_type
```

#### Returns

`str`: a string describing the device that the loaded model will run on


## Tokenizer class

Expand Down Expand Up @@ -267,12 +271,27 @@ onnxruntime_genai.Generator.compute_logits()

### Get output

Returns the output logits of the model.
Returns an output of the model.

```python
onnxruntime_genai.Generator.get_output()
onnxruntime_genai.Generator.get_output(str: name) -> numpy.ndarray[int32]
```

#### Parameters
- `name`: the name of the model output

#### Returns
- `numpy.ndarray[int32]`: a multi dimensional array of the model outputs

#### Example

The following code returns the output logits of a model.

```python
logits = generator.get_output("logits")
```


### Generate next token

Using the current set of logits and the specified generator parameters, calculates the next batch of tokens, using Top P sampling.
Expand Down

0 comments on commit 511174d

Please sign in to comment.