Text Generation
PEFT
Safetensors
Transformers
English
lora
conversational
File size: 2,095 Bytes
50d9838
 
 
 
 
 
 
 
6e249ac
 
 
 
 
50d9838
 
2199f7e
50d9838
2199f7e
50d9838
2199f7e
50d9838
2199f7e
50d9838
2199f7e
50d9838
2199f7e
 
 
50d9838
2199f7e
50d9838
2199f7e
50d9838
2199f7e
50d9838
2199f7e
 
 
50d9838
2199f7e
50d9838
2199f7e
 
 
50d9838
2199f7e
50d9838
2199f7e
 
 
50d9838
2199f7e
50d9838
2199f7e
50d9838
2199f7e
50d9838
2199f7e
50d9838
2199f7e
 
50d9838
2199f7e
50d9838
2199f7e
50d9838
2199f7e
50d9838
2199f7e
50d9838
 
 
2199f7e
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
library_name: peft
pipeline_tag: text-generation
tags:
- base_model:adapter:TinyLlama/TinyLlama-1.1B-Chat-v1.0
- lora
- transformers
license: apache-2.0
datasets:
- LL-Square/CodeForge-TinyLlama1.1B-Instruct
language:
- en
---

# CodeForge-Instruct

Lightweight repository for preparing, training, and uploading small instruct-style models and LoRA adapters.

This project contains simple scripts to train a model (`train.py`), run inference (`main.py`), configure logging (`logging_setup.py`), and upload artifacts (`upload.py`). A small sample dataset is included as `sample.jsonl`.

## Data format

The dataset expects newline-delimited JSON (`.jsonl`) where each line is an object with at least `prompt` and `response` (or `instruction`/`output`) fields. Example (`sample.jsonl`):

```jsonl
{"prompt": "Summarize the following text:", "response": "A short summary."}
```

Adjust `train.py` to match your field names if needed.

## Usage

Training (example):

```bash
python train.py --data sample.jsonl --output-dir ./checkpoints --epochs 3 --batch-size 8
```

Run inference/demo:

```bash
python main.py --model ./checkpoints/latest
```

Upload artifacts (example):

```bash
python upload.py --model ./checkpoints/latest --dest hub-or-bucket
```

See individual scripts for additional flags and configuration.

## Logging

The repository centralizes logging in `logging_setup.py`; import and call `setup_logging()` from other scripts to get consistent formatting and levels.

## Development

- Run linters/formatters as you prefer (e.g. `black`, `ruff`).
- Add tests under a `tests/` folder if you expand behavior.

## Contributing

Open issues or PRs with clear reproduction steps. Keep changes minimal and scoped.

## License

This repository does not include a license file. Add a `LICENSE` if you plan to publish.

### Framework versions

- PEFT 0.18.1
- 
---
If you'd like, I can:
- add a `requirements.txt` with pinned versions,
- add CLI argument parsing examples to `train.py` and `main.py`, or
- create a short CONTRIBUTING guide.