Instructions to use umutagrmn/gemma_4_2b_lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use umutagrmn/gemma_4_2b_lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="umutagrmn/gemma_4_2b_lora") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("umutagrmn/gemma_4_2b_lora") model = AutoModelForMultimodalLM.from_pretrained("umutagrmn/gemma_4_2b_lora", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use umutagrmn/gemma_4_2b_lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "umutagrmn/gemma_4_2b_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": "umutagrmn/gemma_4_2b_lora", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/umutagrmn/gemma_4_2b_lora
- SGLang
How to use umutagrmn/gemma_4_2b_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 "umutagrmn/gemma_4_2b_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": "umutagrmn/gemma_4_2b_lora", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "umutagrmn/gemma_4_2b_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": "umutagrmn/gemma_4_2b_lora", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use umutagrmn/gemma_4_2b_lora with Docker Model Runner:
docker model run hf.co/umutagrmn/gemma_4_2b_lora
Uploaded finetuned model
- Developed by: umutagrmn
- License: apache-2.0
- Finetuned from model : unsloth/gemma-4-e2b-it-unsloth-bnb-4bit
Model Kartı: Gemma 4 2B Düzce Staj Asistanı
Model Özeti
Bu model, Düzce Üniversitesi Bilgisayar Mühendisliği Bölümü staj sürecine ilişkin sorulara cevap verebilecek şekilde ince ayar edilmiş bir Türkçe soru-cevap modelidir. Amaç, öğrencilerin staj süreciyle ilgili sık sorulan sorulara daha doğru ve bağlamsal cevaplar üretmesini sağlamaktır.
Bu sürüm, temel bir Gemma 4 2B taban modeli üzerine LoRA ile ince ayar uygulanmış bir adaptör modelidir.
Model Detayları
- Model ailesi: Gemma 4 2B tabanlı dil modeli
- İnce ayar yöntemi: LoRA adaptör ile ince ayar
- Eğitim hedefi: Staj rehberliği için Türkçe sık sorulan sorulara cevap verme
- İnce ayar verisi: Düzce Üniversitesi Bilgisayar Mühendisliği staj süreçleriyle ilgili soru-cevap verileri
- Veri boyutu: 360 eğitim örneği ve 140 değerlendirme örneği
- Eğitim donanımı: NVIDIA T4 GPU (15 GB VRAM)
- Önemli eğitim ayarları:
- max_seq_length = 512
- load_in_4bit = True
- r = 16
- lora_alpha = 16
- lora_dropout = 0.05
- bias = "none"
- num_train_epochs = 2
Kullanım Amaçları
Bu model aşağıdaki amaçlarla kullanılabilir:
- Düzce Üniversitesi Bilgisayar Mühendisliği staj süreci hakkında genel bilgi verme
- Staj başvurusu, belge yükleme, OBS, rapor, tarih ve süre gibi konularda yardımcı olma
- Türkçe soru-cevap akışında örnek bir bilgi asistanı olarak kullanma
Kapsam Dışı Kullanımlar
Bu model aşağıdaki durumlar için uygun değildir:
- Resmî ve bağlayıcı üniversite/kurum bilgisi verme
- Yasal, resmi veya güncel mevzuat yorumlama
- Kişiye özel staj onayı veya kurum içi karar verme
Eğitim Verisi
Eğitim verisi, Düzce Üniversitesi Bilgisayar Mühendisliği staj sayfasından derlenen sık sorulan sorular ve bu sorulara karşılık gelen Türkçe soru-cevap örneklerinden oluşturulmuştur.
Değerlendirme Sonuçları
140 örnek üzerinden yapılan değerlendirmede aşağıdaki sonuçlar elde edilmiştir:
- Base win %: 13.57
- LoRA win %: 85.0
- Tie %: 1.43
- Base judge score avg %: 52.39
- LoRA judge score avg %: 81.14
Bu sonuçlar, ince ayar edilmiş LoRA modelinin temel modele göre daha iyi performans gösterdiğini desteklemektedir.
Sınırlamalar
- Model, güncel kurum kurallarına her zaman uyumlu olmayabilir.
- Cevaplar, belirli bir dönemde geçerli olan mevzuata göre değişebilir.
- Özellikle karmaşık veya spesifik durumlarda kullanıcıdan resmi kaynak doğrulaması istenmelidir.
- Model, yanlış ama ikna edici cevaplar üretme riski taşır.
Kullanım Örneği
Bu model, uygun bir temel model ile LoRA adaptörü birleştirilerek kullanılabilir. Aşağıdaki örnek, kullanım mantığını göstermektedir:
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_model_id = "<base-model-id>"
adapter_model_id = "umutagrmn/gemma_4_2b_lora"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(base_model_id)
model = PeftModel.from_pretrained(base_model, adapter_model_id)
prompt = "Düzce Üniversitesinde staj başvurusu nasıl yapılır?"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Atıf
Bu modeli kullanırsanız, lütfen ilgili depo ve Hugging Face kaynaklarını referans gösterin.
Bağlantılar
- Veri seti: https://huggingface.co/datasets/umutagrmn/duzce-bm-staj-sikca-sorulan-sorular
- İnce ayar edilmiş model: https://huggingface.co/umutagrmn/gemma_4_2b_lora
- Downloads last month
- 4