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

Add notebook for Messages API usage walkthrough #28

Merged
merged 14 commits into from
Feb 22, 2024

Conversation

andrewrreed
Copy link
Member

What does this PR do?

Adds a notebook that demonstrates how to use the new Messages API functionality from TGI with Inference Endpoints + several client libraries (openai, langchain, llamaindex).

Who can review?

@MKhalusova

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@MKhalusova MKhalusova self-requested a review February 19, 2024 14:29
Copy link
Contributor

@MKhalusova MKhalusova left a comment

Choose a reason for hiding this comment

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

This is a great code example and it's super useful! But I feel that it sounds too much like a marketing pitch. Let's update the markdown descriptions to transform it into a tutorial-style notebook. Some suggestions:

re: Title: let's make it clearer and more task-oriented, e.g. "Migrating from OpenAI models to Open Source LLMs"

Instead of "We are excited to introduce", explain in the introduction what this tutorial is about. E.g. "In this tutorial you'll learn how to use Messages API from TGI (available in version X) to smoothly transition from OpenAI models to any open-source LLM without having to rewrite your existing scripts". Later in the notebook, you have a paragraph that actually would be great in the intro: "Messages support in TGI makes Inference Endpoints directly compatible with the OpenAI Chat Completion API. This means that any existing scripts that use OpenAI models via the OpenAI client libraries can be directly swapped out to use any open LLM running on a TGI endpoint!

With this seamless transition, you can immediately take advantage of the numerous benefits offered by open models:

Complete control and transparency over models and data
No more worrying about rate limits
The ability to fully customize systems according to your specific needs

Let's remove the quote from Johny Crupi.

The rest is great, please review the text and update the style to technical tutorial in places where it sounds like a marketing pitch.

@@ -12,6 +12,7 @@ Check out the recently added notebooks:
- [Fine-tuning a Code LLM on Custom Code on a single GPU](fine_tuning_code_llm_on_single_gpu)
- [RAG Evaluation Using Synthetic data and LLM-As-A-Judge](rag_evaluation)
- [Advanced RAG on HuggingFace documentation using LangChain](advanced_rag)
- [From OpenAI to Open LLMs with Messages API on Hugging Face](tgi_messages_api_demo)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since it'll be the latest added notebook, add it at the top of the list, please

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call! c9a853e

@andrewrreed
Copy link
Member Author

@MKhalusova Thanks for the review and feedback! The reason it sounded so "marketing pitchy" is because it was the exact content from the blog post 😄

I just revamped the wording so its more of a tutorial tone and merged the upstream changes. I think this should be good to go after a quick final review from you. Thanks!

Copy link
Contributor

@MKhalusova MKhalusova left a comment

Choose a reason for hiding this comment

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

Great work re-styling the notebook! Let's merge it :)

@MKhalusova MKhalusova merged commit 9a77de2 into huggingface:main Feb 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants