Skip to content

Commit

Permalink
update poetry version
Browse files Browse the repository at this point in the history
  • Loading branch information
ΠœΠ°Π»Π°Ρ…ΠΎΠ² АлСксСй ΠŸΠ°Π²Π»ΠΎΠ²ΠΈΡ‡ committed Sep 16, 2024
1 parent e5170e9 commit 5e8251c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 23 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ jobs:
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry version patch
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
56 changes: 34 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,43 +128,48 @@ python -m turbo_alignment train_kto --experiment_settings_path configs/exp/train
```

<a name="-multimodal-train"></a>
βŒ›οΈ in progress..
## Multimodal Tasks
## Multimodal train
βŒ›οΈ in progress..
<!-- ## Multimodal Tasks
To start multimodal training, you should:
- **Prepare the multimodal dataset**. See examples [here](docs/dataset_example.md#-multimodel-dataset).
- **Preprocess the data (OPTIONAL)**. If you plan to run many experiments on the same dataset, you should preprocess it. The preprocessing stage includes reading `pixel_values` from images, encoding them with the specified encoder, and saving them in safetensors format. Later, during training, the pipeline will skip the stage of reading and encoding images and only extract prepared encodings from the safetensors files.
- **Suitable config**: [llava.json](tests/fixtures/configs/train/multimodal/llama_llava_base_clip.json),[c_abs.json](tests/fixtures/configs/train/multimodal/llama_c_abs_clip_pickle.json)
- **Suitable config**: [llava.json](tests/fixtures/configs/train/multimodal/llama_llava_base_clip.json),[c_abs.json](tests/fixtures/configs/train/multimodal/llama_c_abs_clip_pickle.json) -->

<a name="-rag-train"></a>
βŒ›οΈ in progress..
## RAG
To launch RAG:
- **Choose a base encoder**, create a document index.
- For **end-to-end**:
- **Train both** the retriever and the generator.
- **Prepare the data** in `"dataset_type": "chat"` **with query -> response.**
- **Suitable config**: [end2end_rag](configs/exp/train/rag/end2end_rag.json)
## RAG (Retrieval-Augmented Generation)

<a name="-sft-rag-train"></a>
### SFT-RAG
- **πŸ“š Dataset type**: prepare your dataset in `ChatDataset`, examples available [here](docs/dataset_example.md#-chat-dataset) format.
- **πŸ“ Configs Example**: [sft_with_retrieval_utility](configs/exp/train/sft/llama/sft_with_retrieval_utility.json)
- **πŸ–₯️ CLI launch command**: ```bash
python -m turbo_alignment train_sft --experiment_settings_path configs/exp/train/sft/llama/sft_with_retrieval_utility.json
```
- For **sft-rag**:
- **Train only** generator
- **Prepare the data** in `"dataset_type": "chat"` with **query+retrieved_documents -> response.**
- **Suitable config**: [sft_with_retrieval_utility](configs/exp/train/sft/llama/sft_with_retrieval_utility.json)
<a name="-e2e-rag-train"></a>
### End2End-RAG
- **πŸ“š Dataset type**: prepare your dataset in `ChatDataset`, examples available [here](docs/dataset_example.md#-chat-dataset) format.
- **πŸ“ Configs Example**: [end2end_rag](configs/exp/train/rag/end2end_rag.json)
- **πŸ–₯️ CLI launch command**: ```bash
python -m turbo_alignment train_rag --experiment_settings_path configs/exp/train/rag/end2end_rag.json
```


<a name="-inference"></a>
# Inference
<a name="-chat-inference"></a>
## Chat Inference
- **πŸ“š Dataset type** prepare your dataset in the `ChatDataset`, examples available [here](docs/dataset_example.md#-chat-dataset) format.
- **πŸ“ Configs Example**: [sft.json](configs/exp/train/sft/sft.json)
- **πŸ“ Configs Example**: [sft.json](configs/exp/inference/generation/default_llama_adapter.json)
- **πŸ–₯️ CLI launch command**
```bash
python -m turbo_alignment inference_chat --inference_settings_path configs/exp/train/sft/sft.json
python -m turbo_alignment inference_chat --inference_settings_path configs/exp/inference/generation/default_llama_adapter.json
```

<a name="-classification-inference"></a>
## Classification Inference
- **πŸ“š Dataset type** prepare your dataset in the `ChatDataset`, examples available [here](docs/dataset_example.md#-chat-dataset) format.
- **πŸ“š Dataset type** prepare your dataset in the `ClassificationDataset`, examples available [here](docs/dataset_example.md#-classification-dataset) format.
- **πŸ“ Configs Example**: [classification_inference.json](configs/exp/inference/classification/classification_inference.json)
- **πŸ–₯️ CLI launch command**
```bash
Expand All @@ -173,11 +178,11 @@ python -m turbo_alignment inference_classification --inference_settings_path con

<a name="-multimodal-inference"></a>
## Multimodal Inference
- **πŸ“š Dataset type** prepare your dataset in the `ChatDataset`, examples available [here](docs/dataset_example.md#-chat-dataset) format.
- **πŸ“š Dataset type** prepare your dataset in the `MultimodalDataset`, examples available [here](docs/dataset_example.md#-multimodal-dataset) format.
- **πŸ“ Configs Example**: [mlp.json](configs/exp/inference/multimodal/mlp.json)
- **πŸ–₯️ CLI launch command**
```bash
python -m turbo_alignment inference_multimodal --inference_settings_path configs/exp/train/sft/sft.json
python -m turbo_alignment inference_multimodal --inference_settings_path configs/exp/inference/multimodal/mlp.json
```

<a name="-rag-inference"></a>
Expand All @@ -186,7 +191,7 @@ python -m turbo_alignment inference_multimodal --inference_settings_path configs
- **πŸ“ Configs Example**: [rag_inference.json](configs/exp/inference/rag/rag_inference.json)
- **πŸ–₯️ CLI launch command**
```bash
python -m turbo_alignment inference_rag --inference_settings_path configs/exp/train/sft/sft.json
python -m turbo_alignment inference_rag --inference_settings_path configs/exp/inference/rag/rag_inference.json
```

<a name="-sampling"></a>
Expand All @@ -211,7 +216,7 @@ python -m turbo_alignment rso_sample --experiment_settings_path tests/fixtures/c

<a name="-rm-sampling"></a>
## Reward Model Sampling
- **πŸ“š Dataset type** prepare your dataset in the `ChatDataset`, examples available [here](docs/dataset_example.md#-sampling-dataset) format.
- **πŸ“š Dataset type** prepare your dataset in the `SamplingRMDataset`, examples available [here](docs/dataset_example.md#-sampling-dataset) format.
- **πŸ“ Configs Example**: [rm.json](tests/fixtures/configs/sampling/rm.json)
- **πŸ–₯️ CLI launch command**
```bash
Expand Down Expand Up @@ -292,6 +297,13 @@ Tutorials are available [here](tutorials/tutorial.md).
This project is licensed, see the [LICENSE](https://github.com/turbo-llm/turbo-alignment/-/blob/main/LICENSE) file for details.


## References

- DPO Trainer implementation inspired by Leandro von Werra et al. (2020) TRL: Transformer Reinforcement Learning. GitHub repository, GitHub. Available at: [https://github.com/huggingface/trl](https://github.com/huggingface/trl).

- Registry implementation inspired by Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F. Liu, Matthew Peters, Michael Schmitz, and Luke S. Zettlemoyer. 2017. AllenNLP: A Deep Semantic Natural Language Processing Platform. Available at: [arXiv:1803.07640](https://arxiv.org/abs/1803.07640).


## Citation

```bibtex
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "turbo-alignment"
packages = [
{ include = "turbo_alignment" },
]
version = "0.0.3"
version = "0.0.2"
description = "turbo-alignment repository"
authors = ["T Mega Alignment Team <[email protected]>" ]
readme = "README.md"
Expand Down

0 comments on commit 5e8251c

Please sign in to comment.