datatune/GLoRE
Viewer β’ Updated β’ 41.5k β’ 121
How to use SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE", device_map="auto")How to use SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE
How to use SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE with Docker Model Runner:
docker model run hf.co/SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE
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 "SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE" \
--host 0.0.0.0 \
--port 30000# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'This repository contains a LoRA adapter fine-tuned on google/gemma-3-1b-it for multi-class text classification using the GLoRE dataset.
The model predicts one of the following 12 labels:
Yes, No, Neutral, (D), A, B, C, D, E, N, (C), (A)
This LoRA adapter is efficient, lightweight, and designed to extend the Gemma-3-1B-IT model with classification capabilities while keeping resource usage low.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = "google/gemma-3-1b-it"
adapter = "SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(base_model)
model = PeftModel.from_pretrained(model, adapter)
text = "Your input here"
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=10)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training Details
The adapter was trained using:
python peft_training.py \
--model-name google/gemma-3-1b-it \
--train-file ../GLoRE/data/splits/train.jsonl \
--output-dir gemma-3-1b-it-LoRA-GLoRE \
--classes Yes No Neutral "(D)" A B C D E N "(C)" "(A)"
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE" \ --host 0.0.0.0 \ --port 30000# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SwashBuckler001/gemma-3-1b-it-LoRA-GLoRE", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'