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

Make agent text-to-sql cookbook #140

Merged
merged 2 commits into from
Jul 8, 2024
Merged

Conversation

aymeric-roucher
Copy link
Collaborator

What does this PR do?

Add two cookbooks: Agentic text-to-SQL + How to use any LLM with transformers agents.

cc @merveenoyan and @stevhliu.

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.

@@ -0,0 +1,317 @@
{
Copy link
Member

@stevhliu stevhliu Jul 8, 2024

Choose a reason for hiding this comment

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

The link to the notebook leads to a 404.

"...to learn more about agents, start with..."

Maybe briefly recap what the llm_engine is for a gentler introduction.


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The 404 is because the notebook is not live yet, but once uploaded on our blog it won't exist anymore.

Just added more detail about llm_engine!

@@ -0,0 +1,317 @@
{
Copy link
Member

@stevhliu stevhliu Jul 8, 2024

Choose a reason for hiding this comment

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

"Hugging Face Serverless API and dedicated Endpoints"

I think it'd be helpful to add some links to the Serverless API and Endpoint docs.

"The Serverless API provides a built-in HfEngine class that lets you use any model on the Hub via the Serverless API or your own dedicated Endpoint."


Reply via ReviewNB

Copy link
Collaborator

@merveenoyan merveenoyan Jul 8, 2024

Choose a reason for hiding this comment

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

also if there's any docs to where someone can create their endpoint would be nice

preferred*

@@ -0,0 +1,317 @@
{
Copy link
Member

@stevhliu stevhliu Jul 8, 2024

Choose a reason for hiding this comment

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

"We directly pass the initialized HfEngine to the llm_engine init of the agent."

"This callable is the heart of the LLM engine."

I don't think you need to nest those bullet points.


Reply via ReviewNB

@@ -0,0 +1,317 @@
{
Copy link
Member

@stevhliu stevhliu Jul 8, 2024

Choose a reason for hiding this comment

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

"...the two main constraints"


Reply via ReviewNB

@@ -0,0 +1,317 @@
{
Copy link
Member

@stevhliu stevhliu Jul 8, 2024

Choose a reason for hiding this comment

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

Change "Anything else" to "Next steps" or something like that to encourage the reader to try something else


Reply via ReviewNB

@@ -0,0 +1,437 @@
{
Copy link
Member

@stevhliu stevhliu Jul 8, 2024

Choose a reason for hiding this comment

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

Add a link to transformers.agents so curious readers can learn more.

Keep formatting consistent for how we refer to text-to-SQL:

"What's the advantage over a classical text-to-SQL pipeline?"

"A classical text-to-SQL pipeline..."

"An agent system is able to critically inspect outputs and decide if the query needs to be changed or not..."


Reply via ReviewNB

@@ -0,0 +1,437 @@
{
Copy link
Member

@stevhliu stevhliu Jul 8, 2024

Choose a reason for hiding this comment

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

"...by the agent system. It gives the LLM information about how to use the tool. So this is where we want..."


Reply via ReviewNB

@@ -0,0 +1,437 @@
{
Copy link
Member

@stevhliu stevhliu Jul 8, 2024

Choose a reason for hiding this comment

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

Maybe also quickly (1-2 sentences) recap the necessary parts of building a tool and then provide a link to the more in-depth doc describing it.


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you, I've made an exhaustive list for this!

@@ -0,0 +1,437 @@
{
Copy link
Member

@stevhliu stevhliu Jul 8, 2024

Choose a reason for hiding this comment

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

Could also probably add a bit more description here about the ReactCodeAgent and llm_engine (for example, you can use another model if you like or another LLM engineer like OpenAI/Anthropic etc.)


Reply via ReviewNB

@@ -0,0 +1,437 @@
{
Copy link
Member

@stevhliu stevhliu Jul 8, 2024

Choose a reason for hiding this comment

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

Maybe rename section to Table joins to be more specific


Reply via ReviewNB

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Wow super cool notebooks, you're on a roll! 🔥

@aymeric-roucher
Copy link
Collaborator Author

Thank you for the review @stevhliu. I've modified the cookbooks following the ideas in your comments! 😃

Copy link
Collaborator

@merveenoyan merveenoyan left a comment

Choose a reason for hiding this comment

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

thanks a lot, simple and very much self-explanatory notebooks!

@stevhliu stevhliu merged commit 7cefd6a into huggingface:main Jul 8, 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.

4 participants