Skip to content

Commit

Permalink
Clarify docs for get_output() (#21009)
Browse files Browse the repository at this point in the history
  • Loading branch information
natke authored Jun 13, 2024
1 parent a15f42d commit 0686549
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
```

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

#### Returns
- `numpy.ndarray`: a multi dimensional array of the model outputs. The shape of the array is shape of the output.

#### 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 0686549

Please sign in to comment.