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

HuggingFace backend implementation #135

Merged

Conversation

dmytrostruk
Copy link
Member

@dmytrostruk dmytrostruk commented Mar 21, 2023

Motivation and Context

HuggingFace is a platform with over 120k different models, so we need to provide a way to use these models with Semantic Kernel. While users can implement their own backend implementation for HuggingFace models, we can provide default implementation which will be ready for usage out-of-the-box.

To run models locally, users can run local inference server from our samples:
https://github.com/microsoft/semantic-kernel/tree/experimental-huggingface/samples/apps/local_inference_server

Description

  1. Fixed CompletionGenerator and EmbeddingGenerator in local inference server.
  2. Implemented HuggingFaceBackend class.
  3. Added unit tests for HuggingFaceBackend.

Contribution Checklist

@dmytrostruk dmytrostruk added PR: ready for review All feedback addressed, ready for reviews .NET Issue or Pull requests regarding .NET code labels Mar 21, 2023
Copy link
Member

@markwallace-microsoft markwallace-microsoft left a comment

Choose a reason for hiding this comment

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

It would be helpful to include the version number user agent

@dluc
Copy link
Collaborator

dluc commented Mar 24, 2023

We need to merge the new backend under the AI namespace, along with OpenAI and Azure OpenAI, following the same naming convention.

@dluc dluc added PR: feedback to address Waiting for PR owner to address comments/questions and removed PR: ready for review All feedback addressed, ready for reviews labels Mar 24, 2023
@dmytrostruk dmytrostruk requested a review from dluc March 24, 2023 11:01
@dmytrostruk dmytrostruk added PR: ready for review All feedback addressed, ready for reviews and removed PR: feedback to address Waiting for PR owner to address comments/questions labels Mar 24, 2023
dotnet/SK-dotnet.sln Outdated Show resolved Hide resolved
@dluc
Copy link
Collaborator

dluc commented Mar 24, 2023

could you run resharper CLI to fix the code style? there are a few missing empty lines and incorrect indentations

@dmytrostruk
Copy link
Member Author

could you run resharper CLI to fix the code style? there are a few missing empty lines and incorrect indentations

@dluc I'm not using resharper, although I run build.sh script which triggers dotnet format. I fixed small code style issue manually, but if there are still some issues, please let me know what steps I need to perform to fix them. Thanks!

@dmytrostruk
Copy link
Member Author

could you run resharper CLI to fix the code style? there are a few missing empty lines and incorrect indentations

@dluc Done, thanks for feedback!

@dmytrostruk dmytrostruk requested a review from dluc March 24, 2023 21:12
@dluc dluc merged commit 715d1d6 into microsoft:experimental-huggingface Mar 25, 2023
golden-aries pushed a commit to golden-aries/semantic-kernel that referenced this pull request Oct 10, 2023
…s on relevant paths (microsoft#135)

### Motivation and Context

<!-- Thank you for your contribution to the copilot-chat 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.
-->
updates deploy scripts to have execute permissions, so that they can run
correctly in Github, and changes build workflows to run only when the
relevant paths are updated.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
Bryan-Roe added a commit to BMR-Cloud-Dev/semantic that referenced this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants