-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into alekseymalakhov11-upd…
…ate-ci-cd
- Loading branch information
Showing
70 changed files
with
774 additions
and
4,723 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name = "turbo-alignment" | |
packages = [ | ||
{ include = "turbo_alignment" }, | ||
] | ||
version = "0.1.0" | ||
version = "0.0.2" | ||
description = "turbo-alignment repository" | ||
authors = ["T Mega Alignment Team <[email protected]>" ] | ||
|
||
|
@@ -44,7 +44,6 @@ pydantic ="^2.7.0" | |
timm ="^0.9.7" | ||
opencv-python = "^4.10.0.84" | ||
langchain-huggingface = "^0.0.3" | ||
ragas = "^0.1.10" | ||
|
||
[tool.poetry.group.deepspeed.dependencies] | ||
accelerate = "0.27" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
# from pathlib import Path | ||
from pathlib import Path | ||
|
||
# import pytest | ||
# from typer.testing import CliRunner | ||
import pytest | ||
from typer.testing import CliRunner | ||
|
||
# from tests.constants import FIXTURES_PATH | ||
# from turbo_alignment.cli import app | ||
# from turbo_alignment.settings.pipelines.inference.multimodal import ( | ||
# MultimodalInferenceExperimentSettings, | ||
# ) | ||
from tests.constants import FIXTURES_PATH | ||
from turbo_alignment.cli import app | ||
from turbo_alignment.settings.pipelines.inference.multimodal import ( | ||
MultimodalInferenceExperimentSettings, | ||
) | ||
|
||
# runner = CliRunner() | ||
runner = CliRunner() | ||
|
||
|
||
# @pytest.mark.parametrize( | ||
# 'config_path', | ||
# [ | ||
# FIXTURES_PATH / 'configs/inference/multimodal/llama_llava_clip_pickle.json', | ||
# ], | ||
# ) | ||
# def test_multimodal_inference_mlp_with_preprocessing(config_path: Path): | ||
# result = runner.invoke( | ||
# app, ['inference_multimodal', '--inference_settings_path', str(config_path)], catch_exceptions=False | ||
# ) | ||
# assert result.exit_code == 0 | ||
# assert MultimodalInferenceExperimentSettings.parse_file(config_path).save_path.is_dir() | ||
@pytest.mark.parametrize( | ||
'config_path', | ||
[ | ||
FIXTURES_PATH / 'configs/inference/multimodal/llama_llava_clip_pickle.json', | ||
], | ||
) | ||
def test_multimodal_inference_mlp_with_preprocessing(config_path: Path): | ||
result = runner.invoke( | ||
app, ['inference_multimodal', '--inference_settings_path', str(config_path)], catch_exceptions=False | ||
) | ||
assert result.exit_code == 0 | ||
assert MultimodalInferenceExperimentSettings.parse_file(config_path).save_path.is_dir() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
{ | ||
"train_dataset_settings": { | ||
"sources": [ | ||
{ | ||
"name": "rm_preferences_test", | ||
"records_path": "tests/fixtures/datasets/rm/train_preferences.jsonl", | ||
"sample_rate": 1 | ||
} | ||
], | ||
"chat_settings":{ | ||
"prompt_template": { | ||
"role_tag_mapping": { | ||
"bot": "<bot>", | ||
"user": "<user>", | ||
"system": "<system>" | ||
}, | ||
"prefix_template": "<RS>{role}", | ||
"suffix_template": "</RS>" | ||
}, | ||
"max_tokens_count": 120 | ||
}, | ||
"add_labels": true, | ||
"dataset_type": "pair_preferences" | ||
}, | ||
"val_dataset_settings": { | ||
"sources": [ | ||
{ | ||
"name": "rm_preferences_test", | ||
"records_path": "tests/fixtures/datasets/rm/val_preferences.jsonl", | ||
"sample_rate": 1 | ||
} | ||
], | ||
"chat_settings":{ | ||
"prompt_template": { | ||
"role_tag_mapping": { | ||
"bot": "<bot>", | ||
"user": "<user>", | ||
"system": "<system>" | ||
}, | ||
"prefix_template": "<RS>{role}", | ||
"suffix_template": "</RS>" | ||
}, | ||
"max_tokens_count": 120 | ||
}, | ||
"add_labels": true, | ||
"dataset_type": "pair_preferences" | ||
}, | ||
"model_settings": { | ||
"model_path": "tests/fixtures/models/llama2_tiny", | ||
"model_type": "causal", | ||
"transformers_settings": {}, | ||
"adapter_path": "tests/fixtures/models/llama2_tiny_fine_tuned_with_adapters/trainer", | ||
"is_trainable": true | ||
}, | ||
"cherry_pick_settings": { | ||
"generator_transformers_settings": { | ||
"num_beams": 1, | ||
"do_sample": false, | ||
"stop_strings": "</RS>", | ||
"max_new_tokens": 8 | ||
}, | ||
"custom_generation_settings": { | ||
"skip_special_tokens": false | ||
}, | ||
"dataset_settings": { | ||
"sources": [ | ||
{ | ||
"name": "chat_test", | ||
"records_path": "tests/fixtures/datasets/chat/train_chat.jsonl", | ||
"num_samples": 2 | ||
} | ||
], | ||
"prompt_template": { | ||
"role_tag_mapping": { | ||
"bot": "<bot>", | ||
"user": "<user>", | ||
"system": "<system>" | ||
}, | ||
"prefix_template": "<RS>{role}", | ||
"suffix_template": "</RS>" | ||
}, | ||
"dataset_type": "chat", | ||
"max_tokens_count": 150, | ||
"only_answer_loss": true | ||
}, | ||
"metric_settings": [ | ||
{ | ||
"type": "length", | ||
"parameters": {"need_average": [true]} | ||
}, | ||
{ | ||
"type": "kl", | ||
"parameters": { | ||
"need_average": [true], | ||
"ref_logits_type": "sft" | ||
} | ||
} | ||
] | ||
}, | ||
"tokenizer_settings": {}, | ||
"trainer_settings": { | ||
"evaluation_strategy": "steps", | ||
"per_device_train_batch_size": 2, | ||
"per_device_eval_batch_size": 2, | ||
"gradient_accumulation_steps": 2, | ||
"eval_steps": 4, | ||
"save_steps": 4, | ||
"logging_steps": 1, | ||
"learning_rate": 0.0003, | ||
"num_train_epochs": 2, | ||
"lr_scheduler_type": "cosine", | ||
"warmup_steps": 2, | ||
"fp16": false, | ||
"bf16": false, | ||
"optim": "adamw_torch", | ||
"save_total_limit": 1, | ||
"average_log_prob": true, | ||
"loss_settings": { | ||
"loss_type": "simpo" | ||
}, | ||
"sync_ref_settings": { | ||
"sync_ref_model": false | ||
}, | ||
"use_ref_model": false, | ||
"use_sft_model": true, | ||
"no_cuda": true | ||
}, | ||
"wandb_settings": { | ||
"project_name": "alignment", | ||
"run_name": "dpo", | ||
"entity": "turbo-alignment" | ||
}, | ||
"log_path": "test_dpo_llama_train_output" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.