Downloads · 30 days
0
rabimba/Gemma-rk-master1
Gemma-rk-master1 is a machine learning model from rabimba. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
The strength of this model is - Coding - Poetic - DPO Trained
Downloads · 30 days
0
Access
Public
Updated Apr 11, 2024
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 62%
From the Hugging Face model README
The strength of this model is
!pip install -qU transformers bitsandbytes accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "rabimba/Gemma-rk-master1"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
)
messages = [{"role": "user", "content": "Explain what a LLM is in less than 100 words."}]
prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])