Downloads · 30 days
586
100% of all-time downloads
picur/picur-120M-instruct
picur-120M-instruct is a text generation model from picur. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
586
100% of all-time downloads
All-time downloads
586
Public
Parameters
120M
242 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors241 MB · 98%
From the Hugging Face model README
PREVIEW!
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "picur/picur-120M-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
messages = [
{"role": "system", "content": "Magázd a felhasználót."},
{"role": "user", "content": "Írj mesét egy öreg halászról, legyen képzeletbeli, hosszú történet"}
]
# Apply Jinja chat template stored in the tokenizer
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
return_dict=True
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=150,
do_sample=True,
temperature=0.7
)
# Decode only the newly generated tokens
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(response)