Downloads · 30 days
217
7% of all-time downloads
latent-artist/f142c54d3ea54565a5ce95f881497e41
f142c54d3ea54565a5ce95f881497e41 is a text generation model from latent-artist. 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.
This repository provides an instruction-tuned causal language model for text generation and chat-style prompts.
Downloads · 30 days
217
7% of all-time downloads
All-time downloads
3K
Public
Parameters
7.6B
15.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors15.2 GB · 100%
From the Hugging Face model README
This repository provides an instruction-tuned causal language model for text generation and chat-style prompts.
The configured snapshot destination is available here.
Use a current release of transformers to load the model and tokenizer:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "latent-artist/f142c54d3ea54565a5ce95f881497e41"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Give me a short introduction to large language models."},
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(**model_inputs, max_new_tokens=512)
generated_ids = [
output_ids[len(input_ids):]
for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
For long inputs, use context settings supported by the installed runtime and account for available memory. See LICENSE for the applicable terms.