-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
base: main
Are you sure you want to change the base?
Python: #6761 Onnx Connector #8106
Conversation
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
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 <taochen@microsoft.com>
…_completion_base.py Co-authored-by: Tao Chen <taochen@microsoft.com>
…_completion_base.py Co-authored-by: Tao Chen <taochen@microsoft.com>
…_chat_completion.py Co-authored-by: Tao Chen <taochen@microsoft.com>
…/nmoeller/semantic-kernel into issue-6761-ONNX-gen-ai-Connector
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_chat_completion.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/services/onnx_gen_ai_chat_completion.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_completion_base.py
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_text_completion.py
Outdated
Show resolved
Hide resolved
…_chat_completion.py Co-authored-by: Tao Chen <taochen@microsoft.com>
…_chat_completion.py Co-authored-by: Tao Chen <taochen@microsoft.com>
…/nmoeller/semantic-kernel into issue-6761-ONNX-gen-ai-Connector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! Some questions for you.
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_chat_completion.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_chat_completion.py
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/services/onnx_gen_ai_completion_base.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_text_completion.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_text_completion.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_chat_completion.py
Outdated
Show resolved
Hide resolved
# With the use of Pybind there is currently no way to load images from bytes | ||
# We can only open images from a file path currently | ||
image = OnnxRuntimeGenAi.Images.open(str(image.uri)) | ||
input_tokens = self.tokenizer(prompt, images=image) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant here is that self.tokenizer
is an object. We probably should not call an object directly. Please verify.
python/tests/integration/completions/chat_completion_test_base.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Tao Chen <taochen@microsoft.com>
…/nmoeller/semantic-kernel into issue-6761-ONNX-gen-ai-Connector
…/nmoeller/semantic-kernel into issue-6761-ONNX-gen-ai-Connector
Eduard is currently oof, and this change request could be blocking.
A couple of typos we'll need to fix: Warning: "interogate" should be "interrogate". |
Also, this is failing on the MacOS unit tests:
|
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