A small language model fine-tuned specifically for photography education — covering composition, exposure, lighting, color theory, post-processing, and camera equipment.
This repo contains the LoRA adapter. Load it on top of the base model:
1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4# Load base model
5base_model = AutoModelForCausalLM.from_pretrained(
6 "Qwen/Qwen3-4B",
7 torch_dtype="auto",
8 device_map="auto"
9)
10tokenizer = AutoTokenizer.from_pretrained("Builder-Neekhil/photography-fundamentals-qwen3-4b")
11
12# Load LoRA adapter
13model = PeftModel.from_pretrained(base_model, "Builder-Neekhil/photography-fundamentals-qwen3-4b")
14
15# Generate
16messages = [
17 {"role": "system", "content": "You are an expert photography instructor."},
18 {"role": "user", "content": "How do I use the exposure triangle for sunset photography?"}
19]
20
21text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
22inputs = tokenizer(text, return_tensors="pt").to(model.device)
23outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7, top_p=0.8)
24print(tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True))
1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B", torch_dtype="auto")
5model = PeftModel.from_pretrained(base_model, "Builder-Neekhil/photography-fundamentals-qwen3-4b")
6merged = model.merge_and_unload()
7merged.save_pretrained("photography-slm-merged")
8AutoTokenizer.from_pretrained("Builder-Neekhil/photography-fundamentals-qwen3-4b").save_pretrained("photography-slm-merged")
Built from
Photo Stack Exchange via
HuggingFaceH4/stack-exchange-preferences (CC-BY-SA 4.0), filtered for photography topics with pm_score ≥ 1. Supplemented with curated synthetic examples.
Apache 2.0 (inherited from Qwen3-4B). Training data under CC-BY-SA 4.0.