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

.Net Hugging Face TGI Chat Completion Message API Support #5785

Conversation

RogerBarreto
Copy link
Member

@RogerBarreto RogerBarreto commented Apr 4, 2024

Motivation and Context

Closes #5403

  1. Adding support to Chat Completion for TGI (Text Generation Inference) Deployment.
  2. Adding Missing UnitTests for Streaming and Non Streaming scenarios (Text/Chat Completion)
  3. Update Metadata + Usage Details for hugging face clients.

Contribution Checklist

…nto features/hugging-face-tgi-chat-completion
…nto features/hugging-face-tgi-chat-completion
Copy link
Contributor

@Krzysztof318 Krzysztof318 left a comment

Choose a reason for hiding this comment

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

Some nit comments :)

@Krzysztof318
Copy link
Contributor

Consider creating also generic SseData class

@stephentoub
Copy link
Member

What's the plan for automatic function calling? Is that going to be in this PR or a follow-up?

@luisquintanilla
Copy link
Member

What's the plan for automatic function calling? Is that going to be in this PR or a follow-up?

@RogerBarreto for reference, here is guidance from HF for tool calling support as part of the Messages API

https://huggingface.co/docs/text-generation-inference/conceptual/guidance#tools-and-functions-

@stephentoub
Copy link
Member

stephentoub commented Apr 8, 2024

What's the plan for automatic function calling? Is that going to be in this PR or a follow-up?

@RogerBarreto for reference, here is guidance from HF for tool calling support as part of the Messages API

https://huggingface.co/docs/text-generation-inference/conceptual/guidance#tools-and-functions-

@luisquintanilla, this PR already adds function calling support... but manual. It's the automated part I was asking about, i.e. where SK itself reads and responds to tool invocation requests rather than passing those back to the caller.

@RogerBarreto
Copy link
Member Author

@stephentoub @luisquintanilla The tool calling behavior will be added as soon we have the abstractions in place. Currently the only piece added to this PR is the Models representing the tool content from the Message API responses.

@RogerBarreto RogerBarreto changed the title .Net Hugging Face TGI Chat Completion Support .Net Hugging Face TGI Chat Completion Message API Support Apr 14, 2024
@RogerBarreto RogerBarreto added this pull request to the merge queue Apr 16, 2024
Merged via the queue into microsoft:main with commit e416946 Apr 16, 2024
15 checks passed
@RogerBarreto RogerBarreto deleted the features/hugging-face-tgi-chat-completion branch April 16, 2024 11:16
LudoCorporateShark pushed a commit to LudoCorporateShark/semantic-kernel that referenced this pull request Aug 25, 2024
…5785)

### Motivation and Context

Closes microsoft#5403 

1. Adding support to Chat Completion for TGI (Text Generation Inference)
Deployment.
3. Adding Missing UnitTests for Streaming and Non Streaming scenarios
(Text/Chat Completion)
4. Update Metadata + Usage Details for hugging face clients.

### Contribution Checklist

- [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#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .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.

.Net: HuggingFace implement also IChatCompletionService?
6 participants