Percy3822
commited on
Commit
·
95c2184
0
Parent(s):
Initial commit
Browse files- .gitattributes +59 -0
- README.md +11 -0
- requirements.txt +1 -0
- sample_dataset.jsonl +50 -0
- train.py +52 -0
.gitattributes
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
# Audio files - uncompressed
|
| 39 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
# Audio files - compressed
|
| 43 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
# Image files - uncompressed
|
| 49 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
# Image files - compressed
|
| 54 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
# Video files - compressed
|
| 58 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
*.webm filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
AI Trainer GUI
|
| 2 |
+
----------------
|
| 3 |
+
|
| 4 |
+
How to Run:
|
| 5 |
+
1. Install Python 3.11+
|
| 6 |
+
2. Double-click ai_trainer_gui.py OR run:
|
| 7 |
+
python ai_trainer_gui.py
|
| 8 |
+
3. Select your dataset and click "Start Training" to simulate AI training.
|
| 9 |
+
4. Exit when done.
|
| 10 |
+
|
| 11 |
+
Next Step: Connect to online GPU for real training.
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
tk
|
sample_dataset.jsonl
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"prompt": "Generate a math question about 1+1", "completion": {"question": "What is 1 + 1?", "options": ["1", "2", "3", "4"], "answer": 1, "explanation": "1 + 1 = 2"}}
|
| 2 |
+
{"prompt": "Generate a math question about 2+2", "completion": {"question": "What is 2 + 2?", "options": ["3", "4", "5", "6"], "answer": 1, "explanation": "2 + 2 = 4"}}
|
| 3 |
+
{"prompt": "Generate a math question about 3+3", "completion": {"question": "What is 3 + 3?", "options": ["5", "6", "7", "8"], "answer": 1, "explanation": "3 + 3 = 6"}}
|
| 4 |
+
{"prompt": "Generate a math question about 4+4", "completion": {"question": "What is 4 + 4?", "options": ["7", "8", "9", "10"], "answer": 1, "explanation": "4 + 4 = 8"}}
|
| 5 |
+
{"prompt": "Generate a math question about 5+5", "completion": {"question": "What is 5 + 5?", "options": ["9", "10", "11", "12"], "answer": 1, "explanation": "5 + 5 = 10"}}
|
| 6 |
+
{"prompt": "Generate a math question about 6+6", "completion": {"question": "What is 6 + 6?", "options": ["11", "12", "13", "14"], "answer": 1, "explanation": "6 + 6 = 12"}}
|
| 7 |
+
{"prompt": "Generate a math question about 7+7", "completion": {"question": "What is 7 + 7?", "options": ["13", "14", "15", "16"], "answer": 1, "explanation": "7 + 7 = 14"}}
|
| 8 |
+
{"prompt": "Generate a math question about 8+8", "completion": {"question": "What is 8 + 8?", "options": ["15", "16", "17", "18"], "answer": 1, "explanation": "8 + 8 = 16"}}
|
| 9 |
+
{"prompt": "Generate a math question about 9+9", "completion": {"question": "What is 9 + 9?", "options": ["17", "18", "19", "20"], "answer": 1, "explanation": "9 + 9 = 18"}}
|
| 10 |
+
{"prompt": "Generate a math question about 10+10", "completion": {"question": "What is 10 + 10?", "options": ["19", "20", "21", "22"], "answer": 1, "explanation": "10 + 10 = 20"}}
|
| 11 |
+
{"prompt": "Generate a math question about 11+11", "completion": {"question": "What is 11 + 11?", "options": ["21", "22", "23", "24"], "answer": 1, "explanation": "11 + 11 = 22"}}
|
| 12 |
+
{"prompt": "Generate a math question about 12+12", "completion": {"question": "What is 12 + 12?", "options": ["23", "24", "25", "26"], "answer": 1, "explanation": "12 + 12 = 24"}}
|
| 13 |
+
{"prompt": "Generate a math question about 13+13", "completion": {"question": "What is 13 + 13?", "options": ["25", "26", "27", "28"], "answer": 1, "explanation": "13 + 13 = 26"}}
|
| 14 |
+
{"prompt": "Generate a math question about 14+14", "completion": {"question": "What is 14 + 14?", "options": ["27", "28", "29", "30"], "answer": 1, "explanation": "14 + 14 = 28"}}
|
| 15 |
+
{"prompt": "Generate a math question about 15+15", "completion": {"question": "What is 15 + 15?", "options": ["29", "30", "31", "32"], "answer": 1, "explanation": "15 + 15 = 30"}}
|
| 16 |
+
{"prompt": "Generate a math question about 16+16", "completion": {"question": "What is 16 + 16?", "options": ["31", "32", "33", "34"], "answer": 1, "explanation": "16 + 16 = 32"}}
|
| 17 |
+
{"prompt": "Generate a math question about 17+17", "completion": {"question": "What is 17 + 17?", "options": ["33", "34", "35", "36"], "answer": 1, "explanation": "17 + 17 = 34"}}
|
| 18 |
+
{"prompt": "Generate a math question about 18+18", "completion": {"question": "What is 18 + 18?", "options": ["35", "36", "37", "38"], "answer": 1, "explanation": "18 + 18 = 36"}}
|
| 19 |
+
{"prompt": "Generate a math question about 19+19", "completion": {"question": "What is 19 + 19?", "options": ["37", "38", "39", "40"], "answer": 1, "explanation": "19 + 19 = 38"}}
|
| 20 |
+
{"prompt": "Generate a math question about 20+20", "completion": {"question": "What is 20 + 20?", "options": ["39", "40", "41", "42"], "answer": 1, "explanation": "20 + 20 = 40"}}
|
| 21 |
+
{"prompt": "Generate a math question about 21+21", "completion": {"question": "What is 21 + 21?", "options": ["41", "42", "43", "44"], "answer": 1, "explanation": "21 + 21 = 42"}}
|
| 22 |
+
{"prompt": "Generate a math question about 22+22", "completion": {"question": "What is 22 + 22?", "options": ["43", "44", "45", "46"], "answer": 1, "explanation": "22 + 22 = 44"}}
|
| 23 |
+
{"prompt": "Generate a math question about 23+23", "completion": {"question": "What is 23 + 23?", "options": ["45", "46", "47", "48"], "answer": 1, "explanation": "23 + 23 = 46"}}
|
| 24 |
+
{"prompt": "Generate a math question about 24+24", "completion": {"question": "What is 24 + 24?", "options": ["47", "48", "49", "50"], "answer": 1, "explanation": "24 + 24 = 48"}}
|
| 25 |
+
{"prompt": "Generate a math question about 25+25", "completion": {"question": "What is 25 + 25?", "options": ["49", "50", "51", "52"], "answer": 1, "explanation": "25 + 25 = 50"}}
|
| 26 |
+
{"prompt": "Generate a math question about 26+26", "completion": {"question": "What is 26 + 26?", "options": ["51", "52", "53", "54"], "answer": 1, "explanation": "26 + 26 = 52"}}
|
| 27 |
+
{"prompt": "Generate a math question about 27+27", "completion": {"question": "What is 27 + 27?", "options": ["53", "54", "55", "56"], "answer": 1, "explanation": "27 + 27 = 54"}}
|
| 28 |
+
{"prompt": "Generate a math question about 28+28", "completion": {"question": "What is 28 + 28?", "options": ["55", "56", "57", "58"], "answer": 1, "explanation": "28 + 28 = 56"}}
|
| 29 |
+
{"prompt": "Generate a math question about 29+29", "completion": {"question": "What is 29 + 29?", "options": ["57", "58", "59", "60"], "answer": 1, "explanation": "29 + 29 = 58"}}
|
| 30 |
+
{"prompt": "Generate a math question about 30+30", "completion": {"question": "What is 30 + 30?", "options": ["59", "60", "61", "62"], "answer": 1, "explanation": "30 + 30 = 60"}}
|
| 31 |
+
{"prompt": "Generate a math question about 31+31", "completion": {"question": "What is 31 + 31?", "options": ["61", "62", "63", "64"], "answer": 1, "explanation": "31 + 31 = 62"}}
|
| 32 |
+
{"prompt": "Generate a math question about 32+32", "completion": {"question": "What is 32 + 32?", "options": ["63", "64", "65", "66"], "answer": 1, "explanation": "32 + 32 = 64"}}
|
| 33 |
+
{"prompt": "Generate a math question about 33+33", "completion": {"question": "What is 33 + 33?", "options": ["65", "66", "67", "68"], "answer": 1, "explanation": "33 + 33 = 66"}}
|
| 34 |
+
{"prompt": "Generate a math question about 34+34", "completion": {"question": "What is 34 + 34?", "options": ["67", "68", "69", "70"], "answer": 1, "explanation": "34 + 34 = 68"}}
|
| 35 |
+
{"prompt": "Generate a math question about 35+35", "completion": {"question": "What is 35 + 35?", "options": ["69", "70", "71", "72"], "answer": 1, "explanation": "35 + 35 = 70"}}
|
| 36 |
+
{"prompt": "Generate a math question about 36+36", "completion": {"question": "What is 36 + 36?", "options": ["71", "72", "73", "74"], "answer": 1, "explanation": "36 + 36 = 72"}}
|
| 37 |
+
{"prompt": "Generate a math question about 37+37", "completion": {"question": "What is 37 + 37?", "options": ["73", "74", "75", "76"], "answer": 1, "explanation": "37 + 37 = 74"}}
|
| 38 |
+
{"prompt": "Generate a math question about 38+38", "completion": {"question": "What is 38 + 38?", "options": ["75", "76", "77", "78"], "answer": 1, "explanation": "38 + 38 = 76"}}
|
| 39 |
+
{"prompt": "Generate a math question about 39+39", "completion": {"question": "What is 39 + 39?", "options": ["77", "78", "79", "80"], "answer": 1, "explanation": "39 + 39 = 78"}}
|
| 40 |
+
{"prompt": "Generate a math question about 40+40", "completion": {"question": "What is 40 + 40?", "options": ["79", "80", "81", "82"], "answer": 1, "explanation": "40 + 40 = 80"}}
|
| 41 |
+
{"prompt": "Generate a math question about 41+41", "completion": {"question": "What is 41 + 41?", "options": ["81", "82", "83", "84"], "answer": 1, "explanation": "41 + 41 = 82"}}
|
| 42 |
+
{"prompt": "Generate a math question about 42+42", "completion": {"question": "What is 42 + 42?", "options": ["83", "84", "85", "86"], "answer": 1, "explanation": "42 + 42 = 84"}}
|
| 43 |
+
{"prompt": "Generate a math question about 43+43", "completion": {"question": "What is 43 + 43?", "options": ["85", "86", "87", "88"], "answer": 1, "explanation": "43 + 43 = 86"}}
|
| 44 |
+
{"prompt": "Generate a math question about 44+44", "completion": {"question": "What is 44 + 44?", "options": ["87", "88", "89", "90"], "answer": 1, "explanation": "44 + 44 = 88"}}
|
| 45 |
+
{"prompt": "Generate a math question about 45+45", "completion": {"question": "What is 45 + 45?", "options": ["89", "90", "91", "92"], "answer": 1, "explanation": "45 + 45 = 90"}}
|
| 46 |
+
{"prompt": "Generate a math question about 46+46", "completion": {"question": "What is 46 + 46?", "options": ["91", "92", "93", "94"], "answer": 1, "explanation": "46 + 46 = 92"}}
|
| 47 |
+
{"prompt": "Generate a math question about 47+47", "completion": {"question": "What is 47 + 47?", "options": ["93", "94", "95", "96"], "answer": 1, "explanation": "47 + 47 = 94"}}
|
| 48 |
+
{"prompt": "Generate a math question about 48+48", "completion": {"question": "What is 48 + 48?", "options": ["95", "96", "97", "98"], "answer": 1, "explanation": "48 + 48 = 96"}}
|
| 49 |
+
{"prompt": "Generate a math question about 49+49", "completion": {"question": "What is 49 + 49?", "options": ["97", "98", "99", "100"], "answer": 1, "explanation": "49 + 49 = 98"}}
|
| 50 |
+
{"prompt": "Generate a math question about 50+50", "completion": {"question": "What is 50 + 50?", "options": ["99", "100", "101", "102"], "answer": 1, "explanation": "50 + 50 = 100"}}
|
train.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
from datasets import load_dataset
|
| 3 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, TrainingArguments, Trainer
|
| 4 |
+
import huggingface_hub
|
| 5 |
+
|
| 6 |
+
# 1. Login to Hugging Face (do once)
|
| 7 |
+
# huggingface_hub.login(token="YOUR_HF_TOKEN")
|
| 8 |
+
|
| 9 |
+
# 2. Load JSONL dataset (local)
|
| 10 |
+
dataset = load_dataset("json", data_files="sample_dataset.jsonl", split="train")
|
| 11 |
+
|
| 12 |
+
# 3. Convert dict completion → string
|
| 13 |
+
def format_for_training(example):
|
| 14 |
+
completion_str = json.dumps(example["completion"])
|
| 15 |
+
return {"text": example["prompt"] + "\n" + completion_str}
|
| 16 |
+
|
| 17 |
+
dataset = dataset.map(format_for_training)
|
| 18 |
+
|
| 19 |
+
# 4. Load small model for low VRAM (good for testing)
|
| 20 |
+
model_name = "distilgpt2" # Small, works on Hugging Face free GPU
|
| 21 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 22 |
+
|
| 23 |
+
def tokenize_function(examples):
|
| 24 |
+
return tokenizer(examples["text"], truncation=True, padding="max_length", max_length=256)
|
| 25 |
+
|
| 26 |
+
tokenized_dataset = dataset.map(tokenize_function, batched=True)
|
| 27 |
+
|
| 28 |
+
# 5. Load model
|
| 29 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 30 |
+
|
| 31 |
+
# 6. Training Arguments (small batch size for low memory)
|
| 32 |
+
training_args = TrainingArguments(
|
| 33 |
+
output_dir="./results",
|
| 34 |
+
overwrite_output_dir=True,
|
| 35 |
+
evaluation_strategy="no",
|
| 36 |
+
per_device_train_batch_size=2,
|
| 37 |
+
num_train_epochs=2,
|
| 38 |
+
save_steps=20,
|
| 39 |
+
logging_steps=5,
|
| 40 |
+
push_to_hub=True, # Upload to Hugging Face Hub
|
| 41 |
+
hub_model_id="Percy3822/quiz_model_test" # Change to your repo name
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
trainer = Trainer(
|
| 45 |
+
model=model,
|
| 46 |
+
args=training_args,
|
| 47 |
+
train_dataset=tokenized_dataset,
|
| 48 |
+
)
|
| 49 |
+
|
| 50 |
+
# 7. Train & push to Hugging Face
|
| 51 |
+
trainer.train()
|
| 52 |
+
trainer.push_to_hub()
|