# English-Amharic Merge
Merged implementation combining encoder-decoder and decoder-only fine-tuning from `dai/english-amharic`, contrastive preference optimization (CPO) from `rahman/english-amharic`, and manual prefix tuning / manual OFT from `rijal/english-amharic`.
## Setup
Copy `local_env.sh.example` to `local_env.sh` and set paths for your environment. Install dependencies from your existing environment (transformers, peft, torch, evaluate, etc.).
Update corpus paths in your config JSON before running.
## Training entry points
| Experiment type | Script | Config flags |
|-----------------|--------|--------------|
| Encoder-decoder SFT / LoRA / full FT | `finetune.py` | Standard `bitexts` with `src`/`tgt` |
| CPO (contrastive preference optimization) | `finetune_cpo.py` | `cpo: true`, bitext with `src`/`good`/`bad` |
| Manual prefix / OFT / stacked adapters | `finetune.py` | `use_prefix_tuning`, `use_oft`, `use_lora` |
| Decoder-only SFT | `finetune_decoder.py` | `model_type: "decoder"`, `train_type: "sft"` |
| Decoder continual pretraining (CPT) | `finetune_decoder.py` | `model_type: "decoder"`, `train_type: "continual_pretrain"` |
| Decoder trainable token embeddings | `finetune_decoder.py` | `model_type: "decoder"`, `train_type: "trainable_tokens"` |
Example configs are in `examples/example_configs/`. Example SLURM job scripts are in `examples/slurm/`.
## Encoder-decoder experiments
On the cluster you typically cannot run training by invoking `python` directly in an interactive terminal — jobs need a GPU and should be submitted through SLURM. Write a shell script (or use one from `examples/slurm/`) with `#SBATCH` headers, `source local_env.sh`, and the `python ... --config ...` command, then submit with `sbatch`.
The `python` commands below show what goes inside that script. To launch a job:
```bash
sbatch examples/slurm/encoder_decoder_sft_lora.sh
```
Or generate a job script from a config with `submit.py` (see SLURM submission).
### Standard S …