Downloads · 30 days
47
3% of all-time downloads
LSX-UniWue/LLaMmlein_1B_chat_selected
LLaMmlein_1B_chat_selected is a machine learning model from LSX-UniWue. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as other.
Downloads · 30 days
47
3% of all-time downloads
All-time downloads
1.5K
Public
Repo size
3 GB
Likes
1
Public
Click a slice to open those files.
.gguf2.2 GB · 89%
From the Hugging Face model README

[!WARNING] While the base versions of our LLäMmlein are quite good, our chat versions are research demonstrations and are not ready to be used in settings where close instruction following is necessary. Please check the paper for more details.
This is a chat adapter for the German Tinyllama 1B language model. Find more details on our page and our preprint! We also merged the adapter and converted it to GGUF here.
import torch
from peft import PeftConfig, PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
torch.manual_seed(42)
# script config
base_model_name = "LSX-UniWue/LLaMmlein_1B_prerelease"
chat_adapter_name = "LSX-UniWue/LLaMmlein_1B_chat_selected"
device = "cuda" # or mps
# chat history
messages = [
{
"role": "user",
"content": """Na wie geht's?""",
},
]
# load model
config = PeftConfig.from_pretrained(chat_adapter_name)
base_model = model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype=torch.bfloat16,
device_map=device,
)
base_model.resize_token_embeddings(32064)
model = PeftModel.from_pretrained(base_model, chat_adapter_name)
tokenizer = AutoTokenizer.from_pretrained(chat_adapter_name)
# encode message in "ChatML" format
chat = tokenizer.apply_chat_template(
messages,
return_tensors="pt",
add_generation_prompt=True,
).to(device)
# generate response
print(
tokenizer.decode(
model.generate(
chat,
max_new_tokens=300,
pad_token_id=tokenizer.pad_token_id,
eos_token_id=tokenizer.eos_token_id,
)[0],
skip_special_tokens=False,
)
)