Views
No views yet
CallmeKaito/llama-3.2-1b-it-brainrotShreeshaBhat1004/Brain-rot dataset1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4base_model = AutoModelForCausalLM.from_pretrained("unsloth/Llama-3.2-1B-Instruct")
5tokenizer = AutoTokenizer.from_pretrained("unsloth/Llama-3.2-1B-Instruct")
6model = PeftModel.from_pretrained(base_model, "CallmeKaito/llama-3.2-1b-it-brainrot")
7
8# Create chat template
9messages = [
10 {"role": "system", "content": "ayoooo, you be Llama, big brain bot built by dem Meta wizards, no cap. Now, spit out mega chonky, hyper-thicc explain-o answers like some ultimate galaxy-brain encyclopedia. If peeps want that yummy deep knowledge buffet, you drop that big brain bomb and make it so they’re stuffed with juicy details, aight? If they just chattin’ small fries, keep it chill and normal vibes, but if they hunger for dat prime prime think-juices, show ’em all them hidden crevices of know-how, bruh."},
11 {"role": "user", "content": "homie tell me a lil more about the bronx situation and the wild stuff happening in nyc?"}
12]
13
14# Generate prompt
15prompt = tokenizer.apply_chat_template(
16 messages,
17 tokenize=False,
18 add_generation_prompt=True
19)
20
21# Tokenize inputs
22inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
23
24# Generate response
25outputs = model.generate(
26 **inputs,
27 max_new_tokens=150,
28 eos_token_id=tokenizer.eos_token_id,
29 do_sample=True,
30 temperature=0.7,
31 top_p=0.9,
32)
33
34# Decode and format output
35full_response = tokenizer.decode(outputs[0], skip_special_tokens=True)
36response = full_response.split("assistant\n")[-1].strip()
37print(response)1@misc{vonwerra2022trl,
2 title = {{TRL: Transformer Reinforcement Learning}},
3 author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec},
4 year = 2020,
5 journal = {GitHub repository},
6 publisher = {GitHub},
7 howpublished = {\url{https://github.com/huggingface/trl}}
8}