-
Notifications
You must be signed in to change notification settings - Fork 453
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
feat: Hugging face - Few Shot Learning with Inference API #2364
Conversation
@FlorentLvr @srini047 can you please review it. Thanks |
"outputs": [], | ||
"source": [ | ||
"MODEL = \"EleutherAI/gpt-neo-1.3B\"\n", | ||
"API_TOKEN = \"<INSERT_API_TOKEN>\"" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add link to this docs as well: https://huggingface.co/docs/api-inference/index#-hosted-inference-api
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, good point.
@srini047 @FlorentLvr I have committed the revision, kindly review. |
"# 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", |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
@srini047 got it. Sure, let me add some information about the model. |
@srini047 @FlorentLvr I have added the requested information, kindly review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
The template is now available on the master branch on this link: |
Thank you for your contribution @srsawant34, your PR has been merged into the master branch of awesome-notebook. |
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.