-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
if os.environ["OLLAMA_MODEL"]: | ||
ollama_setup = True | ||
except KeyError: | ||
OllamaTextCompletion() |
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.
Hmm, if we do this, it's very likely that we will never know if our test pipeline is setup correctly since all of the ollama tests will be skipped instead of failing.
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.
Same for the others in chat & text completion
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
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.
We need to rethink the prompt based setup but the rest looks good!
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
As disscussed with @eavanvalkenburg i introduced hardcoded Templates in the If people want to introduce custom templates they can overwrite the |
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.
Couple of small improvements, but looking good!
Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>
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