# How to do few shot in context learning using GPT-NEO

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-do-few-shot-in-context-learning-using-gpt-neo%2F9926%3E%5C
**Category:** Models\
**Created:** [September 13, 2021, 7:12am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-do-few-shot-in-context-learning-using-gpt-neo%2F9926 "2021-09-13T07:12:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yananchen](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/yananchen/32/37864_2.png) [@yananchen](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fyananchen)%5C
**Post date:** [September 13, 2021, 7:12am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-do-few-shot-in-context-learning-using-gpt-neo%2F9926%2F1 "2021-09-13T07:12:30Z")

</div>

Hello,

I want to use the model from huggingface [EleutherAI/gpt-neo-1.3B · Hugging Face](https://huggingface.co/EleutherAI/gpt-neo-1.3B)  
to do few shot learning.

I write my customized prompt, denoted as my\_customerized\_prompt, like this,

> label:science technology  
> content:Google Making ‘Project Tango’ Tablets With Advanced 3D Vision: Report  
> ###  
> label:science technology  
> content:Uber Confirms “Record Breaking” Fundraising, Interest In Driverless Ubers  
> ###  
> label:health  
> content:‘Biggest investigation’ launched into effects of mobiles  
> ###  
> label:business  
> content:Google Earnings Preview: What Wall Street’s Saying  
> ###  
> label:health  
> content:OECD sees growth slowing as emerging markets lose steam  
> ###  
> label:entertainment  
> content:Zac Efron says he’s up for more ‘High School Musical,’ and so are we  
> ###  
> label:science technology  
> content:An angry letter to eBay: 5 questions it must answer about its security breach  
> ###  
> label:entertainment  
> content:Kate Mulgrew doesn’t think the sun orbits the Earth  
> ###  
> label:science technology  
> content:Lunar eclipse coming  
> ###  
> label:entertainment  
> content:UK police probing Peaches Geldof’s sudden death  
> ###  
> label:health  
> content:CDC: Maine tops nation in rate of long-term opiate prescriptions  
> ###  
> label:entertainment  
> content:‘Animal House’ times 10  
> ###  
> label:business  
> content:Google, Facebook best employers in US: Survey  
> ###  
> label:business  
> content:No Change in Mortgage Rates at TD Bank Today - Tuesday April 15  
> ###  
> label:health  
> content:Breakthrough hepatitis C treatment cures over 90 percent of patients with cirrhosis  
> ###  
> label:poltics  
> content:

and I want gpt-neo to write a new content based on the last “label:politics”, for example.

So how can I put the prompt to gpt-neo.  
Should I just simply give it as the usual prompt, similar to gpt-2?  
like this?

> from transformers import pipeline  
> generator = pipeline(‘text-generation’, model=‘EleutherAI/gpt-neo-1.3B’)  
> generator(my\_customerized\_prompt, do\_sample=True, min\_length=50)

Thanks.
