mirror of
https://github.com/marvinscham/masterthesis-playground.git
synced 2026-03-22 00:12:42 +01:00
40 lines
864 B
Markdown
40 lines
864 B
Markdown
# Retrieval-Augmented Finetuning (RAFT)
|
|
|
|
## Voraussetzungen
|
|
|
|
- Generelles Preprocessing (Voraussetzung für BERTopic)
|
|
- BERTopic
|
|
- Klassifikation muss durchgeführt sein, `data/intermediate/culture_reviews.csv` muss existieren
|
|
|
|
## Vorbereiten des Retrieval-Corpus
|
|
|
|
```bash
|
|
python prepare_corpus.py --input_tab ../data/intermediate/culture_reviews.csv --out_dir out
|
|
```
|
|
|
|
## Erstellen des RAFT-Datensatzes
|
|
|
|
```bash
|
|
python make_raft_data.py --out_dir out --n_examples 10
|
|
```
|
|
|
|
## Training der QLoRA-Adapter
|
|
|
|
```bash
|
|
python train_mistral_raft.py --train_jsonl out/raft_train.jsonl --out_dir out/mistral_balitwin_lora
|
|
```
|
|
|
|
## Inferenz
|
|
|
|
### Per Baseline Mistral 7B + PEFT-Adapter
|
|
|
|
```bash
|
|
python rag_chat.py --lora_dir out/mistral_balitwin_lora
|
|
```
|
|
|
|
### Pre-Merged Modell + Adapter
|
|
|
|
```bash
|
|
python rag_chat_merged.py --model_dir /path/to/model_folder --out_dir out
|
|
```
|