BatboldSamdan commited on
Commit
c962b43
·
verified ·
1 Parent(s): a9be086

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +54 -0
README.md ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ base_model: Qwen/Qwen2.5-0.5B-Instruct
6
+ library_name: transformers
7
+ pipeline_tag: text-generation
8
+ tags:
9
+ - lora
10
+ - peft
11
+ - chatbot
12
+ - portfolio
13
+ ---
14
+
15
+ # BabyBata 2.0 🍼
16
+
17
+ A small assistant that answers questions about [Batbold Samdan](https://github.com/batbold9182)'s portfolio: his projects, skills, education and contact info. An AI/ML **learning project**.
18
+
19
+ - **Base model:** [Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct)
20
+ - **Method:** LoRA fine-tuning (r=16, all attention + MLP projections, 1.7% of weights trained), merged into the base model, saved in float16
21
+ - **Data:** ~630 generated conversations: topic Q&A, "does he know X?", "I don't know" cases, off-topic refusals, multi-turn follow-ups
22
+ - **Training:** 3 epochs on a free Colab T4 (~10 min), loss on assistant replies only
23
+ - **Code:** [github.com/batbold9182/babybata](https://github.com/batbold9182/babybata)
24
+
25
+ ## Important: it needs the profile
26
+ BabyBata is trained to answer **from a fact sheet in the system prompt** (grounding), not from memory. Use it with the same system prompt it was trained with: the rules + `profile.txt` from the repo (`bot.py` builds it).
27
+
28
+ ```python
29
+ from transformers import AutoModelForCausalLM, AutoTokenizer
30
+
31
+ repo = "BatboldSamdan/babybata2"
32
+ tokenizer = AutoTokenizer.from_pretrained(repo)
33
+ model = AutoModelForCausalLM.from_pretrained(repo)
34
+
35
+ system = open("babybata2/profile.txt").read() # in practice: bot.system_prompt() from the repo
36
+ messages = [{"role": "system", "content": system},
37
+ {"role": "user", "content": "what projects has he built?"}]
38
+ inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True)
39
+ out = model.generate(**inputs, max_new_tokens=100)
40
+ print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
41
+ ```
42
+
43
+ ## Evaluation
44
+ Custom fact check on questions not in the training data (incl. honesty checks like "does he know Rust?" → must say it doesn't know):
45
+
46
+ | Model | Score |
47
+ |---|---|
48
+ | Qwen2.5-0.5B-Instruct + profile, no fine-tuning | 18/27 |
49
+ | BabyBata 2.0 v1 | 26/27 (4 test questions had leaked into training dialogues, so slightly optimistic) |
50
+
51
+ ## Limitations
52
+ - Only knows what's in the profile; it's a small model and can still be wrong. Verify important details on the portfolio site.
53
+ - Known v1 issues: sometimes loses track in follow-up questions; once claimed a project had a live demo when it doesn't.
54
+ - All training data is public information from the portfolio site.