Views
No views yet
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 runtransformers >= 4.43.0, you can run conversational inference using the pipeline abstraction or by leveraging the Auto classes with generate().pip install --upgrade transformers.1import torch
2import transformers
3
4model_id = "vjkhambe/tiny-gpt-0.1-1m"
5device = 0 if torch.cuda.is_available() else -1
6dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32
7
8model = transformers.AutoModelForCausalLM.from_pretrained(
9 model_id,
10 trust_remote_code=True,
11 dtype=dtype,
12)
13tokenizer = transformers.AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
14model.generation_config.max_length = None
15model.generation_config.max_new_tokens = 64
16
17pipeline = transformers.pipeline(
18 "text-generation",
19 model=model,
20 tokenizer=tokenizer,
21 device=device,
22)
23
24print(pipeline("Hey how are you doing today?"))tiny_gpt_pretraintraining_config.yamlvjkhambe/tiny-gpt-0.1-1m