Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "gemma-3-1b-it-4bit-lora-dpo-aligned"
4model = AutoModelForCausalLM.from_pretrained(model_name)
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6
7# Example inference
8prompt = "Explain quantum computing in simple terms."
9inputs = tokenizer(prompt, return_tensors="pt")
10outputs = model.generate(**inputs, max_length=200)
11response = tokenizer.decode(outputs[0], skip_special_tokens=True)@misc{gemma3,
title={Gemma 3},
author={Google DeepMind},
year={2026}
}
@article{rafailov2023direct,
title={Direct Preference Optimization: Your Language Model is Secretly a Reward Model},
author={Rafailov, Rafael and Sharma, Archit and Mitchell, Eric and Manning, Christopher D and Finn, Chelsea and Ermon, Stefano},
journal={arXiv preprint arXiv:2305.18290},
year={2023}
}