Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python config API docs #22951

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from

Conversation

RyanUnderhill
Copy link
Member

Description

Motivation and Context

@@ -28,6 +28,57 @@ pip install onnxruntime-genai
import onnxruntime_genai
```

## Config class

If the config needs to be modified at runtime to change providers/set provider options, this object can be first created and used, then a model can be created from this config object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is perhaps obvious but maybe worth stating that if the user does not create the object, then the config is used directly from the file in the model folder


### Add a provider to the list

If the provider isn't already in the list of providers, this adds it to the end of the list.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does adding to the end of the list mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to find onnxruntime docs about how the provider list works, but couldn't find anything obvious. I don't think we should be explaining it here, do you know where it is?


### Clear list of providers

Clears the list of providers. This is the only way to remove existing providers to enforce using only a specific provider.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the list is cleared, what provider is used? CPU? Can you state that?

onnxruntime_genai.Config.set_provider_option(provider_name: str, option_name: str, option_value: str)
```

#### Parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an example of setting a new provider, as that is the scenario we are addressing with this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants