CoolFace
Modelpublic

RichardErkhov/segestic_-_Tinystories-gpt-0.1-3m-4bits

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes90downloads
Model Card

Quantization made by Richard Erkhov.

Github

Discord

Request more models

Tinystories-gpt-0.1-3m - bnb 4bits

  • —Model creator: https://huggingface.co/segestic/
  • —Original model: https://huggingface.co/segestic/Tinystories-gpt-0.1-3m/

Original model description: --- datasets:

  • —roneneldan/TinyStories language:
  • —en libraryname: transformers pipelinetag: text-generation ---

We tried to use the huggingface transformers library to recreate the TinyStories models on Consumer GPU using GPT2 Architecture instead of GPT-Neo Architecture orignally used in the paper (https://arxiv.org/abs/2305.07759). Output model is 15mb and has 3 million parameters.

------ EXAMPLE USAGE 1 ---

from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("segestic/Tinystories-gpt-0.1-3m")

model = AutoModelForCausalLM.from_pretrained("segestic/Tinystories-gpt-0.1-3m")

prompt = "Once upon a time there was"

inputids = tokenizer.encode(prompt, returntensors="pt")

Generate completion

output = model.generate(inputids, maxlength = 1000, num_beams=1)

Decode the completion

outputtext = tokenizer.decode(output[0], skipspecial_tokens=True)

Print the generated text

print(output_text)

------ EXAMPLE USAGE 2 ------

Use a pipeline as a high-level helper

from transformers import pipeline

pipeline

pipe = pipeline("text-generation", model="segestic/Tinystories-gpt-0.1-3m")

prompt

prompt = "where is the little girl"

generate completion

output = pipe(prompt, maxlength=1000, numbeams=1)

decode the completion

generatedtext = output[0]['generatedtext']

Print the generated text

print(generated_text)