Views
No views yet
Once upon a time, people were going to buy the “cork” that was used to wrap and hang the wine.
However, what began to be called “cork” as soon as the time rolled around was probably an artificial wine. This is how we know cork as the “cork”
Once upon a time, there was a time in the history of India when the great religion of India was worshipped by only two people… the Hindus and the Jains. This is the story of how the story of India was created.
India’s story begins with a very ancient Vedic religion. They were the ancient Indus valley
Once upon a time, the King of Italy, who was to govern what would become the world, thought that it would be a great and noble undertaking to introduce the Roman Senate into the country in order to defend Rome — to defend her own capital in a very civilized manner, to promote the arts and promote the Roman religion. Accordingly, Rome,1>>> from transformers import pipeline, set_seed
2>>> generator = pipeline('text-generation', model='fraserlove/gpt-alpha')
3>>> set_seed(0)
4>>> generator('Once upon a time,', max_length=30, num_return_sequences=5, do_sample=True)
5
6[{'generated_text': 'Once upon a time, my father had some way that would help him win his first war. There was a man named John. He was the husband'},
7 {'generated_text': 'Once upon a time, this particular breed would be considered a “chicken fan”; today, the breed is classified as a chicken.'},
8 {'generated_text': 'Once upon a time, there was a famous English nobleman named King Arthur (in the Middle Ages, it was called ‘the Arthur’'},
9 {'generated_text': "Once upon a time, the Christian God created the world in the manner which, under different circumstances, was true of the world's existence. The universe"},
10 {'generated_text': 'Once upon a time, I wrote all of the letters of an alphabets in a single document. Then I read each letter of that alphabet'}]1from transformers import AutoTokenizer, AutoModelForCausalLM
2device = 'cuda' # for GPU usage or 'cpu' for CPU usage
3tokeniser = AutoTokenizer.from_pretrained('fraserlove/gpt-alpha')
4# For multi-GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map='auto')`
5model = AutoModelForCausalLM.from_pretrained('fraserlove/gpt-alpha').to(device)
6context = tokeniser.encode('Once upon a time,', return_tensors='pt').to(device)
7samples = model.generate(context, do_sample=True)
8print(tokeniser.decode(samples[0]))1from transformers import AutoTokenizer, AutoModelForCausalLM
2device = 'cuda' # for GPU usage or 'cpu' for CPU usage
3tokeniser = AutoTokenizer.from_pretrained('fraserlove/gpt-alpha')
4model = AutoModelForCausalLM.from_pretrained('fraserlove/gpt-alpha').to(device)
5encoded = tokeniser('Once upon a time,', return_tensors='pt').to(device)
6output = model(**encoded)| Benchmark | GPT-α 124M | GPT-2 124M | GPT-Neo 125M | OPT 125M | Pythia 160M |
|---|---|---|---|---|---|
| PIQA | 63.06% | 62.51% | 62.46% | 62.08% | 61.26% |
| SIQA | 38.18% | 36.59% | 37.21% | 37.21% | 36.69% |
| OpenBookQA | 29.80% | 27.20% | 26.20% | 28.00% | 27.00% |
| TriviaQA | 1.31% | 0.30% | 0.66% | 1.18% | 0.41% |
| TruthfulQA | 33.13% | 31.73% | 35.70% | 33.50% | 34.75% |
| MMLU | 23.30% | 25.90% | 25.58% | 25.94% | 25.10% |
| WinoGrande | 50.20% | 50.04% | 51.70% | 51.07% | 48.78% |
| ARC Challenge | 29.18% | 22.95% | 22.87% | 22.10% | 22.10% |
| HellaSwag | 35.74% | 31.64% | 30.58% | 31.69% | 30.15% |
| GSM-8K | 2.27% | 0.68% | 1.74% | 1.74% | 2.20% |
| Average Score | 30.62% | 28.95% | 29.47% | 29.45% | 28.84% |