Text Generation
PEFT
Safetensors
Transformers
lora
code-graphs
sw-engineering
bug-localization
conversational
Instructions to use yvliet/perron-gemma4-e2b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use yvliet/perron-gemma4-e2b-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-e2b-it") model = PeftModel.from_pretrained(base_model, "yvliet/perron-gemma4-e2b-lora") - Transformers
How to use yvliet/perron-gemma4-e2b-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yvliet/perron-gemma4-e2b-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("yvliet/perron-gemma4-e2b-lora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yvliet/perron-gemma4-e2b-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yvliet/perron-gemma4-e2b-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yvliet/perron-gemma4-e2b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yvliet/perron-gemma4-e2b-lora
- SGLang
How to use yvliet/perron-gemma4-e2b-lora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "yvliet/perron-gemma4-e2b-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yvliet/perron-gemma4-e2b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "yvliet/perron-gemma4-e2b-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yvliet/perron-gemma4-e2b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yvliet/perron-gemma4-e2b-lora with Docker Model Runner:
docker model run hf.co/yvliet/perron-gemma4-e2b-lora
Perron Gemma 4 E2B LoRA Adapter
Parameter-efficient Low-Rank Adaptation (LoRA) adapter for Google DeepMind's google/gemma-4-e2b-it model, trained on provenance-conditioned candidate ranking over SWE-bench dependency multigraphs.
Model Summary
- Author: Sultan Haikal (GitHub: @yvliet)
- Base Model:
google/gemma-4-e2b-it - Architecture: Dense PLE Transformer, 2B parameters
- Adapter Configuration: LoRA rank $r=16$, $\alpha=32$, dropout $0.05$ targeting language model attention projections (
q_proj,v_proj,k_proj,o_proj) - Trainable Parameters: ~4.7M (<0.25% of total base parameters)
- License: Apache 2.0
Training Details
- Objective: Provenance-Conditioned Ranking Cross-Entropy ($\mathcal{L}_{\text{Rank}}$) over atomic candidate choices
[A]through[Y] - Active Loss Slicing: Sequence length 2048 with tail token slicing (
logits_to_keep=24) - Optimization: AdamW, learning rate 2e-4, linear warmup with cosine decay
- Hardware: Dual Tesla T4 GPUs (sharded pipeline via
device_map="auto") - Validation Receipts ($N=50$ held-out pairs):
- Epoch 1: Loss 0.6391, Val Acc@1: 98.0%, Val Acc@5: 100.0%
- Epoch 2: Loss 0.0074, Val Acc@1: 100.0%, Val Acc@5: 100.0%
- Epoch 3: Loss 0.0002, Val Acc@1: 100.0%, Val Acc@5: 100.0%
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "google/gemma-4-e2b-it"
adapter_id = "yvliet/perron-gemma4-e2b-lora"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)
Citation & Resources
- Repository: https://github.com/yvliet/perron
- PyPI Library: https://pypi.org/project/perron-core/
- Downloads last month
- 8