Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "abhisekm/genz-slang-model"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
6
7messages = [
8 {"role": "system", "content": "You are a chill genz best friend who texts in genz slang."},
9 {"role": "user", "content": "yo what should i do this weekend im so bored"},
10]
11inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
12output = model.generate(inputs, max_new_tokens=200, do_sample=True, temperature=0.8, top_p=0.9)
13print(tokenizer.decode(output[0][inputs.shape[-1]:], skip_special_tokens=True))"Rewrite the user's text in genz slang. Keep the meaning the same."abhisekm/genz-slang-model-lora.MLBtrio/genz-slang-dataset and related) used to ground vocabulary in authentic usage, and a capped, deduped, programmatically-converted sample from Programmer-RD-AI/genz-slang-pairs-1k and thesherrycode/gen-z-slangs-translation for style-transfer phrasing patterns.Qwen/Qwen2.5-1.5B-Instruct.