Skip to content

Commit

Permalink
FIX: Fix CI on transformers main (huggingface#1576)
Browse files Browse the repository at this point in the history
* Update run_dpo.sh

* Update run_sft.sh

* Update clis.mdx

* Update example_config.yaml

* Update test_cli.py

* Update testing_constants.py

* Update test_dpo_trainer.py
  • Loading branch information
younesbelkada authored Apr 23, 2024
1 parent f30daa4 commit 9f68ead
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions commands/run_dpo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This script runs an SFT example end-to-end on a tiny model using different possible configurations
# but defaults to QLoRA + PEFT
OUTPUT_DIR="test_dpo/"
MODEL_NAME="HuggingFaceM4/tiny-random-LlamaForCausalLM"
MODEL_NAME="trl-internal-testing/tiny-random-LlamaForCausalLM"
DATASET_NAME="trl-internal-testing/hh-rlhf-trl-style"
MAX_STEPS=5
BATCH_SIZE=2
Expand Down Expand Up @@ -55,4 +55,4 @@ echo "Starting program..."
echo "Operation Failed!"
exit 1
}
exit 0
exit 0
2 changes: 1 addition & 1 deletion commands/run_sft.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This script runs an SFT example end-to-end on a tiny model using different possible configurations
# but defaults to QLoRA + PEFT
OUTPUT_DIR="test_sft/"
MODEL_NAME="HuggingFaceM4/tiny-random-LlamaForCausalLM"
MODEL_NAME="trl-internal-testing/tiny-random-LlamaForCausalLM"
DATASET_NAME="imdb"
MAX_STEPS=5
BATCH_SIZE=2
Expand Down
4 changes: 2 additions & 2 deletions docs/source/clis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ We also recommend you passing a YAML config file to configure your training prot

```yaml
model_name_or_path:
HuggingFaceM4/tiny-random-LlamaForCausalLM
trl-internal-testing/tiny-random-LlamaForCausalLM
dataset_name:
imdb
dataset_text_field:
Expand Down Expand Up @@ -116,4 +116,4 @@ Besides talking to the model there are a few commands you can use:
- **save {SAVE_NAME} (optional)**: save the current chat and settings to file by default to `./chat_history/{MODEL_NAME}/chat_{DATETIME}.yaml` or `{SAVE_NAME}` if provided
- **exit**: closes the interface

The default examples are defined in `examples/scripts/config/default_chat_config.yaml` but you can pass your own with `--config CONFIG_FILE` where you can also specify the default generation parameters.
The default examples are defined in `examples/scripts/config/default_chat_config.yaml` but you can pass your own with `--config CONFIG_FILE` where you can also specify the default generation parameters.
2 changes: 1 addition & 1 deletion example_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# CUDA_VISIBLE_DEVICES: 0

model_name_or_path:
HuggingFaceM4/tiny-random-LlamaForCausalLM
trl-internal-testing/tiny-random-LlamaForCausalLM
dataset_name:
imdb
dataset_text_field:
Expand Down
2 changes: 1 addition & 1 deletion tests/slow/testing_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# TODO: push them under trl-org
MODELS_TO_TEST = [
"HuggingFaceM4/tiny-random-LlamaForCausalLM",
"trl-internal-testing/tiny-random-LlamaForCausalLM",
"HuggingFaceM4/tiny-random-MistralForCausalLM",
]

Expand Down
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def test_sft_cli():
try:
subprocess.run(
"trl sft --max_steps 1 --output_dir tmp-sft --model_name_or_path HuggingFaceM4/tiny-random-LlamaForCausalLM --dataset_name imdb --learning_rate 1e-4 --lr_scheduler_type cosine --dataset_text_field text",
"trl sft --max_steps 1 --output_dir tmp-sft --model_name_or_path trl-internal-testing/tiny-random-LlamaForCausalLM --dataset_name imdb --learning_rate 1e-4 --lr_scheduler_type cosine --dataset_text_field text",
shell=True,
check=True,
)
Expand All @@ -32,7 +32,7 @@ def test_sft_cli():
def test_dpo_cli():
try:
subprocess.run(
"trl dpo --max_steps 1 --output_dir tmp-dpo --model_name_or_path HuggingFaceM4/tiny-random-LlamaForCausalLM --dataset_name trl-internal-testing/hh-rlhf-trl-style --learning_rate 1e-4 --lr_scheduler_type cosine --sanity_check",
"trl dpo --max_steps 1 --output_dir tmp-dpo --model_name_or_path trl-internal-testing/tiny-random-LlamaForCausalLM --dataset_name trl-internal-testing/hh-rlhf-trl-style --learning_rate 1e-4 --lr_scheduler_type cosine --sanity_check",
shell=True,
check=True,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_dpo_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def test_dpo_lora_bf16_autocast_llama(self):
# Note this test only works on compute capability > 7 GPU devices
from peft import LoraConfig

model_id = "HuggingFaceM4/tiny-random-LlamaForCausalLM"
model_id = "trl-internal-testing/tiny-random-LlamaForCausalLM"
tokenizer = AutoTokenizer.from_pretrained(model_id)

lora_config = LoraConfig(
Expand Down Expand Up @@ -519,7 +519,7 @@ def test_dpo_lora_bf16_autocast(self, name, loss_type, pre_compute, gen_during_e
def test_dpo_lora_tags(self):
from peft import LoraConfig

model_id = "HuggingFaceM4/tiny-random-LlamaForCausalLM"
model_id = "trl-internal-testing/tiny-random-LlamaForCausalLM"
tokenizer = AutoTokenizer.from_pretrained(model_id)

lora_config = LoraConfig(
Expand Down

0 comments on commit 9f68ead

Please sign in to comment.