-
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
Added a text completion connector to oobabooga text-generation-webui project #1357
Added a text completion connector to oobabooga text-generation-webui project #1357
Conversation
@microsoft-github-policy-service agree company="My Intelligence Agency" |
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.
@jsboige Awesome work, thank you! I left initial comments, when they will be resolved, I will test this functionality locally and if everything works as expected, we will merge it to main! Thanks again!
dotnet/src/Connectors/Connectors.AI.Oobabooga/TextCompletion/OoobaboogaTextCompletion.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.Oobabooga/TextCompletion/OoobaboogaTextCompletion.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.Oobabooga/TextCompletion/OoobaboogaTextCompletion.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.Oobabooga/TextCompletion/OoobaboogaTextCompletion.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.Oobabooga/TextCompletion/OoobaboogaTextCompletion.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.Oobabooga/TextCompletion/TextCompletionRequest.cs
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.Oobabooga/TextCompletion/OoobaboogaTextCompletion.cs
Outdated
Show resolved
Hide resolved
dotnet/src/IntegrationTests/Connectors/Oobabooga/OobaboogaTextCompletionTests.cs
Show resolved
Hide resolved
Merge main
… test websocket server
Merge upstream
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.
Tested this connector locally using integration tests - everything works as expected.
Merge upstream
Please ignore Spell Check pipeline issue for now - we are going to fix that separately. PR still can be merged. |
dotnet/src/Connectors/Connectors.AI.Oobabooga/TextCompletion/OobaboogaTextCompletion.cs
Outdated
Show resolved
Hide resolved
@dmytrostruk , @RogerBarreto, In the mean time, I would really appreciate your feedback on those complicated issues. Edit: It seems you've been busy, so I just reverted to a single Channel based Result class since it seems to do the job, and wrapped up the unit tests. |
@jsboige Thank you for the updates. I will review this PR and reply shortly. |
update upstream
merge upstream
Hi @dmytrostruk, do you have any news concerning this PR? I'll be happy to contribute some more, but since this has been open for quite some time now, and it does add a new project to the solution, it would be nice if we can wrap it up and move on. |
@jsboige Thanks for all the hard work! We'll help take this home. I've merged the whole PR into a feature branch in the sk repo, where we'll easily be able to address any conflicts and @dmytrostruk will bring it into main. If there are any further changes you'd like to push in the meantime, please add them to the "feature/oobabooga" branch. Thanks again! |
Hi @shawncal , thanks for moving on with merging this PR. |
Hi, this is a new PR from a new user-level fork to account for a github bug preventing edits by maintainers on a PR made from an organization-level fork (see that [final comment](#1357 (comment)) on last PR) This PR is only an attempt at merging upstream's main for final integration of the oobabooga connector into main branch. Last set of commits made CompleteRequestSettings.MaxTokens Nullable ([#450f1d3a11eb95d6975da33f581d3997bed42906](#1367)), which broke this connector. Making TextCompletionRequest.MaxNewTokens also nullable fixed the issue. Note that Oobabooga [defaults max tokens to 200](https://github.com/oobabooga/text-generation-webui/blob/main/extensions/api/util.py#L24) Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com>
### 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. --> Merge [feature/oobabooga](https://github.com/microsoft/semantic-kernel/tree/feature/oobabooga) branch to `main` with [Oobabooga](https://github.com/oobabooga/text-generation-webui) AI Connector functionality. Functionality verified with unit and integration testing. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> From original PR (#1357): > This PR adds to the solution a project similar to HuggingFace connectors project, and an additional integration test also similar to HuggingFace connector's The code for the connector was based on the existing HuggingFace's, with a couple improvements (e.g. using web sockets for streaming API) ### 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#dev-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: Jean-Sylvain Boige <jsboige@gmail.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Jean-Sylvain Boige <jsboige@gmail.com> Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com> Co-authored-by: Gina Triolo <51341242+gitri-ms@users.noreply.github.com> Co-authored-by: Devis Lucato <dluc@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Craig Presti <146438+craigomatic@users.noreply.github.com> Co-authored-by: Craig Presti <craig.presti@microsoft.com> Co-authored-by: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com> Co-authored-by: Teresa Hoang <125500434+teresaqhoang@users.noreply.github.com> Co-authored-by: Abby Harrison <54643756+awharrison-28@users.noreply.github.com> Co-authored-by: Tao Chen <TaoChenOSU@users.noreply.github.com> Co-authored-by: Aman Sachan <51973971+amsacha@users.noreply.github.com> Co-authored-by: cschadewitz <schadewitzcasey@gmail.com> Co-authored-by: Abby Harrison <abby.harrison@microsoft.com>
### 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. --> Merge [feature/oobabooga](https://github.com/microsoft/semantic-kernel/tree/feature/oobabooga) branch to `main` with [Oobabooga](https://github.com/oobabooga/text-generation-webui) AI Connector functionality. Functionality verified with unit and integration testing. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> From original PR (microsoft#1357): > This PR adds to the solution a project similar to HuggingFace connectors project, and an additional integration test also similar to HuggingFace connector's The code for the connector was based on the existing HuggingFace's, with a couple improvements (e.g. using web sockets for streaming API) ### 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#dev-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: Jean-Sylvain Boige <jsboige@gmail.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Jean-Sylvain Boige <jsboige@gmail.com> Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com> Co-authored-by: Gina Triolo <51341242+gitri-ms@users.noreply.github.com> Co-authored-by: Devis Lucato <dluc@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Craig Presti <146438+craigomatic@users.noreply.github.com> Co-authored-by: Craig Presti <craig.presti@microsoft.com> Co-authored-by: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com> Co-authored-by: Teresa Hoang <125500434+teresaqhoang@users.noreply.github.com> Co-authored-by: Abby Harrison <54643756+awharrison-28@users.noreply.github.com> Co-authored-by: Tao Chen <TaoChenOSU@users.noreply.github.com> Co-authored-by: Aman Sachan <51973971+amsacha@users.noreply.github.com> Co-authored-by: cschadewitz <schadewitzcasey@gmail.com> Co-authored-by: Abby Harrison <abby.harrison@microsoft.com>
Any chance this could be done for the python package please? |
Motivation and Context
Oobabooga's text-generation-webui is the most popular open-source platform to host LLMs. It has a web API that supports blocking and streaming requests.
Having a connector to oobabooga brings semantic-kernel to the global "local Llamas" community.
Description
This PR adds to the solution a project similar to HuggingFace connectors project, and an additional integration test also similar to HuggingFace connector's
The code for the connector was based on the existing HuggingFace's, with a couple improvements (e.g. using web sockets for streaming API)
Contribution Checklist
dotnet format
As for HuggingFace, the integration tests are meant to be tested manually together with oobabooga installed with a model selected and a running API. Both the blocking and streaming APIs were tested succesfully, though parameters mappings from sk's CompleteRequestSettings to oobabooga's TextCompletionRequest was done very roughly and would need adjusting since some units scales don't match, and oobabooga's API has a lot more parameters to feed, but I suppose it works well enough for an first version.