How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="ambrosfitz/tinyllama-history-chat_v0.2")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("ambrosfitz/tinyllama-history-chat_v0.2")
model = AutoModelForCausalLM.from_pretrained("ambrosfitz/tinyllama-history-chat_v0.2")
messages = [
    {"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links

Run summary:

train/epoch 13.91
train/global_step 40
train/learning_rate 0.0
train/loss 0.2795
train/total_flos 4134138886176768.0
train/train_loss 1.33859
train/train_runtime 1368.8841
train/train_samples_per_second 10.344
train/train_steps_per_second 0.029

Downloads last month
17
Safetensors
Model size
1B params
Tensor type
F16
·
Inference Providers NEW
Input a message to start chatting with ambrosfitz/tinyllama-history-chat_v0.2.

Model tree for ambrosfitz/tinyllama-history-chat_v0.2

Quantizations
1 model