Downloads · 30 days
5
14% of all-time downloads
vjkhambe/tiny-gpt-0.7-1m
tiny-gpt-0.7-1m is a machine learning model from vjkhambe. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This repository contains a pretrained TinyGPT checkpoint published for public use. This checkpoint is provided for educational and experimentation purposes.
Downloads · 30 days
5
14% of all-time downloads
All-time downloads
36
Public
Parameters
1.6M
20.9 MB on disk
Likes
0
Public
Click a slice to open those files.
.pt28.4 MB · 80%
From the Hugging Face model README
This repository contains a pretrained TinyGPT checkpoint published for public use. This checkpoint is provided for educational and experimentation purposes.
tiny_gpt_checkpoint.pt: training checkpoint with model and optimizer statetokenizer.model: SentencePiece tokenizer used for training and generationconfig.json: model configuration serialized from the checkpointtraining_config.yaml: training and MLflow settings used for the runUse with Transformers.
Starting with transformers >= 4.43.0, you can run conversational inference using the pipeline abstraction or by leveraging the Auto classes with generate().
Make sure to update your Transformers installation via pip install --upgrade transformers.
import torch
import transformers
model_id = "vjkhambe/tiny-gpt-0.7-1m"
device = 0 if torch.cuda.is_available() else -1
dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32
model = transformers.AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
dtype=dtype,
)
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model.generation_config.max_length = None
model.generation_config.max_new_tokens = 64
pipeline = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
device=device,
)
print(pipeline("Hey how are you doing today?"))
tiny_gpt_pretraintraining_config.yamlReleased under the Apache-2.0 license.
Target repo: vjkhambe/tiny-gpt-0.7-1m