Upload QUICK_TEST_COMMAND.md with huggingface_hub
Browse files- QUICK_TEST_COMMAND.md +81 -0
QUICK_TEST_COMMAND.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# π Quick Test Command for Single Training Sample
|
| 2 |
+
|
| 3 |
+
## β
Updated Command (With Fixes Applied)
|
| 4 |
+
|
| 5 |
+
```bash
|
| 6 |
+
cd /workspace/ftt/codellama-migration && source /venv/main/bin/activate && python3 test_single_training_sample.py
|
| 7 |
+
```
|
| 8 |
+
|
| 9 |
+
**This will:**
|
| 10 |
+
- Load the first training sample
|
| 11 |
+
- Test with temperatures: 0.1, 0.2, 0.3
|
| 12 |
+
- Show expected vs generated output
|
| 13 |
+
- Help you find the best temperature
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
## π§ Manual Test Command (Custom Temperature)
|
| 18 |
+
|
| 19 |
+
```bash
|
| 20 |
+
cd /workspace/ftt/codellama-migration
|
| 21 |
+
source /venv/main/bin/activate
|
| 22 |
+
|
| 23 |
+
# Extract sample #1 instruction
|
| 24 |
+
INSTRUCTION=$(sed -n '1p' datasets/processed/split/train.jsonl | python3 -c "import sys, json; print(json.load(sys.stdin)['instruction'])")
|
| 25 |
+
|
| 26 |
+
# Test with optimized parameters
|
| 27 |
+
python3 scripts/inference/inference_codellama.py \
|
| 28 |
+
--mode local \
|
| 29 |
+
--model-path training-outputs/codellama-fifo-v1 \
|
| 30 |
+
--prompt "$INSTRUCTION" \
|
| 31 |
+
--max-new-tokens 1000 \
|
| 32 |
+
--temperature 0.1
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
## π― Key Hyperparameter Changes Made
|
| 38 |
+
|
| 39 |
+
| Parameter | Old | New | Impact |
|
| 40 |
+
|-----------|-----|-----|--------|
|
| 41 |
+
| **Repetition Penalty** | 1.1 | **1.2** | β
Prevents repetitive text |
|
| 42 |
+
| **Prompt Format** | No EOS | **+ EOS token** | β
Matches training format |
|
| 43 |
+
| **Temperature** | 0.3 | **0.1 (recommended)** | β
More deterministic |
|
| 44 |
+
| **Response Extraction** | Full decode | **New tokens only** | β
Cleaner output |
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
## π Expected Results
|
| 49 |
+
|
| 50 |
+
With these changes, you should see:
|
| 51 |
+
- β
**Verilog code generation** (not text notes)
|
| 52 |
+
- β
**Complete modules** (module ... endmodule)
|
| 53 |
+
- β
**No repetitive "Note:" statements**
|
| 54 |
+
- β
**Better match with training data**
|
| 55 |
+
|
| 56 |
+
---
|
| 57 |
+
|
| 58 |
+
## π If Still Getting Text Instead of Code
|
| 59 |
+
|
| 60 |
+
Try these in order:
|
| 61 |
+
|
| 62 |
+
1. **Lower temperature to 0.05:**
|
| 63 |
+
```bash
|
| 64 |
+
--temperature 0.05
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
2. **Increase repetition penalty to 1.3:**
|
| 68 |
+
(Edit inference script or add as parameter)
|
| 69 |
+
|
| 70 |
+
3. **Check prompt format:**
|
| 71 |
+
- Ensure instruction matches training data exactly
|
| 72 |
+
- No extra formatting or wrappers
|
| 73 |
+
|
| 74 |
+
4. **Verify training data format:**
|
| 75 |
+
- Should be: `instruction + EOS + response + EOS`
|
| 76 |
+
- Response should start with ```verilog
|
| 77 |
+
|
| 78 |
+
---
|
| 79 |
+
|
| 80 |
+
**Test and let me know the results!**
|
| 81 |
+
|