Views
No views yet
age (int)dependents (int)monthlyIncome (float, 2 decimals)monthlyBills (float, 2 decimals)monthlyEntertainment (float, 2 decimals)savingAmount (float, 2 decimals)assets (float, 2 decimals)salesSkills (int, 1–9)riskLevel (int, 1–9)confidence (int, 1–9)businessDifficulty (int, 1–9)r=16, alpha=32, target modules = Q/K/V/O projections)bitsandbytesper_device_train_batch_size=8, grad_accum=4)adamw_torch1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch, re, json
3
4model_id = "nellaep/ThePeoplesFinance-ParamsGen-TinyLlama-LoRA"
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
7
8SYSTEM_HEADER = (
9 "Task: Generate ONE realistic finance profile as compact JSON (no markdown, no comments).\n"
10 "Keys: age, dependents, monthlyIncome, monthlyBills, monthlyEntertainment,\n"
11 " savingAmount, assets, salesSkills, riskLevel, confidence, businessDifficulty.\n"
12 "Rules:\n"
13 "- Use integers for age, dependents, salesSkills, riskLevel, confidence, businessDifficulty.\n"
14 "- Use two decimals for money fields.\n"
15 "- Do NOT include any score or extra keys.\n"
16 "- Output JSON only."
17)
18
19prompt = SYSTEM_HEADER + "\nAnswer:"
20
21inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
22with torch.inference_mode():
23 gen = model.generate(
24 **inputs,
25 max_new_tokens=160,
26 do_sample=True,
27 temperature=0.8,
28 top_p=0.9,
29 eos_token_id=tokenizer.eos_token_id
30 )
31
32text = tokenizer.decode(gen[0], skip_special_tokens=True)
33print("Raw output:", text)
34
35# Extract JSON
36m = re.search(r"\{.*\}", text, flags=re.DOTALL)
37if m:
38 profile = json.loads(m.group(0))
39 print("Parsed profile:", profile)1{
2 "age": 32,
3 "dependents": 2,
4 "monthlyIncome": 7200.00,
5 "monthlyBills": 3100.00,
6 "monthlyEntertainment": 450.00,
7 "savingAmount": 12000.00,
8 "assets": 25000.00,
9 "salesSkills": 6,
10 "riskLevel": 5,
11 "confidence": 7,
12 "businessDifficulty": 3
13}Prompt condition: "age between 25 and 40; prefer 2 dependents; higher savingAmount; monthlyIncome around 6000-10000; entertainment moderate"1{
2 "age": 29,
3 "dependents": 2,
4 "monthlyIncome": 8900.00,
5 "monthlyBills": 3200.00,
6 "monthlyEntertainment": 600.00,
7 "savingAmount": 20000.00,
8 "assets": 40000.00,
9 "salesSkills": 7,
10 "riskLevel": 6,
11 "confidence": 8,
12 "businessDifficulty": 4
13}@misc{nellaep2025paramsgen,
title = {ThePeoplesFinance — Parameters-Only Generator (TinyLlama + LoRA)},
author = {Barnes, Darnell (nellaep)},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/nellaep/ThePeoplesFinance-ParamsGen-TinyLlama-LoRA}}
}