-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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: #6761 Onnx Connector #8106
Merged
moonbox3
merged 67 commits into
microsoft:main
from
nmoeller:issue-6761-ONNX-gen-ai-Connector
Oct 10, 2024
Merged
Python: #6761 Onnx Connector #8106
moonbox3
merged 67 commits into
microsoft:main
from
nmoeller:issue-6761-ONNX-gen-ai-Connector
Oct 10, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
markwallace-microsoft
added
the
python
Pull requests for the Python Semantic Kernel
label
Aug 14, 2024
nmoeller
changed the title
Python : Issue-6761-Onnx-Connector
Python: Issue-6761-Onnx-Connector
Aug 14, 2024
nmoeller
changed the title
Python: Issue-6761-Onnx-Connector
Python: #6761 Onnx Connector
Aug 14, 2024
TaoChenOSU
reviewed
Aug 15, 2024
python/semantic_kernel/connectors/ai/onnx/services/onnx_text_completion.py
Outdated
Show resolved
Hide resolved
…/nmoeller/semantic-kernel into issue-6761-ONNX-gen-ai-Connector
…i-Connector # Conflicts: # python/tests/integration/completions/chat_completion_test_base.py # python/uv.lock
TaoChenOSU
reviewed
Sep 18, 2024
python/semantic_kernel/connectors/ai/onnx/onnx_gen_ai_prompt_execution_settings.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_chat_completion.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/onnx_gen_ai_settings.py
Outdated
Show resolved
Hide resolved
Regarding our offline conversation on the prompt template, is using a prompt template to parse the chat history to some format an overkill? Prompt template can do much more that substituting arguments. Is it possible to override the |
…_completion_base.py Co-authored-by: Tao Chen <[email protected]>
…_completion_base.py Co-authored-by: Tao Chen <[email protected]>
…_completion_base.py Co-authored-by: Tao Chen <[email protected]>
…_chat_completion.py Co-authored-by: Tao Chen <[email protected]>
…/nmoeller/semantic-kernel into issue-6761-ONNX-gen-ai-Connector
…/nmoeller/semantic-kernel into issue-6761-ONNX-gen-ai-Connector
Thanks for the contribution! Will approve once the unit tests pass. |
moonbox3
approved these changes
Oct 9, 2024
TaoChenOSU
approved these changes
Oct 9, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Oct 9, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Oct 9, 2024
moonbox3
approved these changes
Oct 10, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 10, 2024
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> 1. Why is this changed required ? To enable Onnx Models with Semantic Kernel, there was the issue #6761 in the Backlog to add a Onnx Connector 2. What problem does it solve ? It solves the problem, that semantic kernel is not yet integrated with Onnx Gen Ai Runtime 3. What scenario does it contribute to? The scenario is to use different connector than HF,OpenAI or AzureOpenAI. When User's want to use Onnx they can easliy integrate it now 4. If it fixes an open issue, please link to the issue here. #6761 ### Description The changes made are designed by my own based on other connectors, i tried to stay as close as possible to the structure. For the integration i installed the mistral python package in the repository. I added the following Classes : - OnnxCompletionBase --> Responsible to control the inference - OnnxTextCompletion --> Inherits from OnnxCompletionBase - Support for Text Completion with and without Images - Ready for Multimodal Inference - Ready for Text Only Inference - Supports all Models on [onnxruntime-genai](https://github.com/microsoft/onnxruntime-genai) - OnnxChatCompletion -->Inherits from OnnxCompletionBase - Support for Text Completion with and without Images - The user needs to provide the corresponding chat template to use this class - Ready for Multimodal Inference - Ready for Text Only Inference - Supports all Models on [onnxruntime-genai](https://github.com/microsoft/onnxruntime-genai) What is integrated yet : - [X] OnnxCompletionBase Class - [x] OnnxChatCompletionBase Class with Dynamic Template Support - [x] OnnxTextCompletionBase Class - [x] Sample Multimodal Inference with Phi3-Vision - [x] Sample of OnnxChatCompletions with Phi3 - [x] Sample of OnnxTextCompletions with Phi3 - [x] Integration Tests - [x] Unit Tests ### Some Notes ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Tao Chen <[email protected]> Co-authored-by: Eduard van Valkenburg <[email protected]>
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Oct 10, 2024
…/nmoeller/semantic-kernel into issue-6761-ONNX-gen-ai-Connector
moonbox3
approved these changes
Oct 10, 2024
Python Test Coverage ReportPython Unit Test Overview
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
To enable Onnx Models with Semantic Kernel, there was the issue Python: Add support for local models via ONNX #6761 in the Backlog to add a Onnx Connector
It solves the problem, that semantic kernel is not yet integrated with Onnx Gen Ai Runtime
The scenario is to use different connector than HF,OpenAI or AzureOpenAI. When User's want to use Onnx they can easliy integrate it now
Python: Add support for local models via ONNX #6761
Description
The changes made are designed by my own based on other connectors, i tried to stay as close as possible to the structure.
For the integration i installed the mistral python package in the repository.
I added the following Classes :
What is integrated yet :
Some Notes
Contribution Checklist