--- base_model: google/gemma-3-1b-it library_name: peft pipeline_tag: text-generation language: en license: mit tags: - lora - sft - transformers - trl - unsloth - fine-tuned datasets: - theprint/Advocate-9.4k --- # DevilsAdvocate-1B A fine-tuned Gemma 3 1B model, fine tuned for more engaging conversation, encouraging the user to think about different aspects. ## Model Details This model is a fine-tuned version of google/gemma-3-1b-it using the Unsloth framework with LoRA (Low-Rank Adaptation) for efficient training. - **Developed by:** theprint - **Model type:** Causal Language Model (Fine-tuned with LoRA) - **Language:** en - **License:** mit - **Base model:** google/gemma-3-1b-it - **Fine-tuning method:** LoRA with rank 128 ## Intended Use General conversation, project feedback and brainstorming. ## GGUF Quantized Versions Quantized GGUF versions are available in the [theprint/DevilsAdvocate-1B-GGUF](https://huggingface.co/theprint/DevilsAdvocate-1B-GGUF) repo. - `DevilsAdvocate-1B-f16.gguf` (2489.6 MB) - 16-bit float (original precision, largest file) - `DevilsAdvocate-1B-q3_k_m.gguf` (850.9 MB) - 3-bit quantization (medium quality) - `DevilsAdvocate-1B-q4_k_m.gguf` (966.7 MB) - 4-bit quantization (medium, recommended for most use cases) - `DevilsAdvocate-1B-q5_k_m.gguf` (1027.9 MB) - 5-bit quantization (medium, good quality) - `DevilsAdvocate-1B-q6_k.gguf` (1270.9 MB) - 6-bit quantization (high quality) - `DevilsAdvocate-1B-q8_0.gguf` (1325.8 MB) - 8-bit quantization (very high quality) ## Training Details ### Training Data The data set used is [theprint/Advocate-9.4k](https://huggingface.co/datasets/theprint/Advocate-9.4k). - **Dataset:** theprint/Advocate-9.4k - **Format:** alpaca ### Training Procedure - **Training epochs:** 2 - **LoRA rank:** 128 - **Learning rate:** 3e-05 - **Batch size:** 4 - **Framework:** Unsloth + transformers + PEFT - **Hardware:** NVIDIA RTX 5090 ## Usage ```python from unsloth import FastLanguageModel import torch # Load model and tokenizer model, tokenizer = FastLanguageModel.from_pretrained( model_name="theprint/DevilsAdvocate-1B", max_seq_length=4096, dtype=None, load_in_4bit=True, ) # Enable inference mode FastLanguageModel.for_inference(model) # Example usage inputs = tokenizer(["Your prompt here"], return_tensors="pt") outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7) response = tokenizer.decode(outputs[0], skip_special_tokens=True) print(response) ``` ### Alternative Usage (Standard Transformers) ```python from transformers import AutoModelForCausalLM, AutoTokenizer import torch model = AutoModelForCausalLM.from_pretrained( "theprint/DevilsAdvocate-1B", torch_dtype=torch.float16, device_map="auto" ) tokenizer = AutoTokenizer.from_pretrained("theprint/DevilsAdvocate-1B") # Example usage messages = [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Your question here"} ] inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True) outputs = model.generate(inputs, max_new_tokens=256, temperature=0.7, do_sample=True) response = tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True) print(response) ``` ### Using with llama.cpp ```bash # Download a quantized version (q4_k_m recommended for most use cases) wget https://huggingface.co/theprint/DevilsAdvocate-1B/resolve/main/gguf/DevilsAdvocate-1B-q4_k_m.gguf # Run with llama.cpp ./llama.cpp/main -m DevilsAdvocate-1B-q4_k_m.gguf -p "Your prompt here" -n 256 ``` ## Limitations May provide incorrect information. ## Citation If you use this model, please cite: ```bibtex @misc{devilsadvocate_1b, title={DevilsAdvocate-1B: Fine-tuned google/gemma-3-1b-it}, author={theprint}, year={2025}, publisher={Hugging Face}, url={https://huggingface.co/theprint/DevilsAdvocate-1B} } ``` ## Acknowledgments - Base model: [google/gemma-3-1b-it](https://huggingface.co/google/gemma-3-1b-it) - Training dataset: [theprint/Advocate-9.4k](https://huggingface.co/datasets/theprint/Advocate-9.4k) - Fine-tuning framework: [Unsloth](https://github.com/unslothai/unsloth) - Quantization: [llama.cpp](https://github.com/ggerganov/llama.cpp)