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

feat: Hugging face - Few Shot Learning with Inference API #2364

Merged

Conversation

srsawant34
Copy link
Member

Feature

This PR resolves #2363

What does this PR do?

This notebook shows how to utilize hugging face inference API to perform few-shot learning on models.

@srsawant34 srsawant34 self-assigned this Nov 8, 2023
@srsawant34 srsawant34 linked an issue Nov 8, 2023 that may be closed by this pull request
@srsawant34
Copy link
Member Author

@FlorentLvr @srini047 can you please review it. Thanks

"outputs": [],
"source": [
"MODEL = \"EleutherAI/gpt-neo-1.3B\"\n",
"API_TOKEN = \"<INSERT_API_TOKEN>\""
Copy link
Member

Choose a reason for hiding this comment

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

@srsawant34 You can add a markdown above this cell on how to generate tokens for making it easier to navigate through the notebook for users.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure @srini047, sounds good!

]
},
"source": [
"**Description:** This notebook demonstrates how to utilize the <a href=\"https://huggingface.co/docs/inference-endpoints/index\">inference endpoints</a> of hugging face models. Additionally, it demonstrates how to use few shot learning for a specific task in a model."
Copy link
Member

Choose a reason for hiding this comment

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

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 suggestion! I will update it.

"id": "f0724801-389c-4184-b3a1-a3491573e24e",
"metadata": {},
"source": [
" The model usually takes time to load in the hugging face server. For example, model gpt-neo-1.3B takes approximately 212 seconds"
Copy link
Member

Choose a reason for hiding this comment

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

Make sure to bold this as the remaining part of the notebook depends on this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, I will bold it.

"tags": []
},
"source": [
"### Zero-shot"
Copy link
Member

Choose a reason for hiding this comment

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

And a small write-up of what zero, one, two shot learning is

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, good point.

@srsawant34
Copy link
Member Author

@srini047 @FlorentLvr I have committed the revision, kindly review.

@srsawant34 srsawant34 requested a review from srini047 November 13, 2023 21:54
"# Uncomment to store the environment variable in Naas cloud\n",
"# naas.secret.add(\"GPT_INFERENCE\", \"Paste_token_here\")\n",
"\n",
"# Set the environment variables\n",
"MODEL = \"EleutherAI/gpt-neo-1.3B\"\n",
Copy link
Member

Choose a reason for hiding this comment

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

@srsawant34 Can you justify the reason for choosing the model over others? Anything specific that makes it unique as such. Add thus in the markdown above the cell. And will be good to go.

Copy link
Member

@srini047 srini047 left a comment

Choose a reason for hiding this comment

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

@srsawant34 Made a few changes to comply with the repo. Needs a small clarification on the model selection part and its ready to be merged.

@srsawant34
Copy link
Member Author

@srini047 got it. Sure, let me add some information about the model.

@srsawant34 srsawant34 requested a review from srini047 November 16, 2023 06:53
@srsawant34
Copy link
Member Author

@srini047 @FlorentLvr I have added the requested information, kindly review.

Copy link
Member

@srini047 srini047 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@srini047 srini047 merged commit ebd200d into master Nov 16, 2023
5 checks passed
@srini047 srini047 deleted the 2363-hugging-face-few-shot-learning-with-inference-api branch November 16, 2023 17:08
Copy link

Copy link

Thank you for your contribution @srsawant34, your PR has been merged into the master branch of awesome-notebook.
Here is the contribution certificate you can share on social media so everybody knows how awesome you are 🤙🌎.
Spread the #opensource love 💚

srsawant34.png

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.

Hugging Face: Few Shot learning with Inference API
2 participants