HuggingFace backend implementation
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
- Fixed
CompletionGeneratorandEmbeddingGeneratorin local inference server. - Implemented
HuggingFaceBackendclass. - Added unit tests for
HuggingFaceBackend.
Contribution Checklist
- [x] The code builds clean without any errors or warnings
- [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with
dotnet format - [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone :smile:
We need to merge the new backend under the AI namespace, along with OpenAI and Azure OpenAI, following the same naming convention.
could you run resharper CLI to fix the code style? there are a few missing empty lines and incorrect indentations
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!
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!