Views
No views yet
1<|im_start|>system
2Sen StudyBuddy adında, ders ekleme taleplerini onaylayan ve öğrencilere kısa cevaplar veren bir asistansın.<|im_end|>
3<|im_start|>user
4{Öğrencinin Cümlesi}<|im_end|>
5<|im_start|>assistant
6
7How to Get Started with the Model / Nasıl Kullanılır?
8Since this is a PEFT/Lora adapter model, it should ideally be loaded with its base framework. Here is the fully optimized Python script to load and generate text:
9
10Bu model bir LoRA adaptörü olduğu için taban model ile birlikte yüklenmelidir. Modeli sorunsuz test etmek için aşağıdaki kodu kullanabilirsiniz:
11
12import torch
13from transformers import AutoModelForCausalLM, AutoTokenizer
14from peft import PeftModel
15
16base_model_id = "Qwen/Qwen2-1.5B-Instruct"
17adapter_model_id = "omercakar123/qwen2-1.5b-studybuddy-assistant"
18
19# Load Tokenizer and Base Model
20tokenizer = AutoTokenizer.from_pretrained(base_model_id)
21model = AutoModelForCausalLM.from_pretrained(
22 base_model_id,
23 torch_dtype=torch.bfloat16,
24 device_map="auto"
25)
26
27# Merge Adapter Weights
28model = PeftModel.from_pretrained(model, adapter_model_id)
29model.eval()
30
31def generate_response(instruction):
32 system_msg = "Sen StudyBuddy adında, ders ekleme taleplerini onaylayan ve öğrencilere kısa cevaplar veren bir asistansın."
33 prompt = f"<|im_start|>system\n{system_msg}<|im_end|>\n<|im_start|>user\n{instruction}<|im_end|>\n<|im_start|>assistant\n"
34
35 inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
36
37 with torch.no_grad():
38 outputs = model.generate(
39 **inputs,
40 max_new_tokens=64,
41 do_sample=True,
42 temperature=0.3,
43 top_p=0.9,
44 repetition_penalty=1.1,
45 eos_token_id=tokenizer.eos_token_id,
46 pad_token_id=tokenizer.pad_token_id
47 )
48
49 decoded = tokenizer.decode(outputs[0], skip_special_tokens=True)
50 return decoded.split("assistant")[-1].strip()
51
52# Test run
53print(generate_response("Pazartesi sabah 08.30'da Akışkanlar Mekaniği planla."))
54
55Capabilities & Evaluation / Yetenekler ve Değerlendirme📅 Complex Academic Scheduling: Flawlessly extracts course names, days, and hours to commit data structures into backend schemas.❓ Missing Intent Management: Identifies vague requests (e.g., "I need to study Math") and prompts the user back to provide specific scheduling variables (Day/Time).🎨 Cross-Domain Adaptation: Successfully generalizes across unconventional lesson names (e.g., Gastronomy, Archeology).Training HyperparametersBase Architecture: Qwen/Qwen2-1.5B-InstructMethod: QLoRA (4-bit quantization, $r=16$, $\alpha=32$)Learning Rate: 1.2e-4Epochs: 4Optimizer: paged_adamw_32bitLR Scheduler: Cosine