Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give h2oGPT proper personality #73

Closed
arnocandel opened this issue Apr 21, 2023 · 8 comments
Closed

Give h2oGPT proper personality #73

arnocandel opened this issue Apr 21, 2023 · 8 comments

Comments

@arnocandel
Copy link
Member

arnocandel commented Apr 21, 2023

Fix https://github.com/h2oai/h2ogpt/blob/main/FAQ.md#why-does-the-h2ogpt-say-it-was-trained-by-openai-or-open-assistant

@arnocandel
Copy link
Member Author

arnocandel commented Apr 21, 2023

def test_add_open_assistant(fixup_personality, only_personality, save_json=True):

(env) arno@rippa:/nfs4/llm/h2ogpt(main)$ NCCL_P2P_LEVEL=LOC WORLD_SIZE=2 CUDA_VISIBLE_DEVICES="0,1" torchrun --nproc_per_node=2 finetune.py --base_model=h2oai/h2ogpt-oig-oasst1-512-6.9b --data_path=h2oai/openassistant_oasst1_h2ogpt_only --micro_batch_size=2 --batch_size=32 --cutoff_len=2048 --run_id=100 --num_epochs=1 &> run.100.text

https://slack-files.com/T0329MHH6-F054U3491DF-a909f3bb3b lora weights and logs

@arnocandel
Copy link
Member Author

arnocandel commented Apr 21, 2023

Comparing validation score on only 1k ShareGPT before/after personality refresh, so just "hammering" the personality updates, and nothing else.

before:
CUDA_VISIBLE_DEVICES=1 python generate.py --base_model=h2oai/h2ogpt-oig-oasst1-512-6.9b --prompt_type='human_bot' --chat=False --stream_output=False --gradio=False --eval_sharegpt_prompts_only=1000 --eval_sharegpt_as_output=False --num_beams=1 &> h2ogpt-oig-oasst1-512-6.9b.eval.log
h2ogpt-oig-oasst1-512-6.9b.eval.log

df_scores_1000_1000_1234_False_h2ogpt-oig-oasst1-512-6 9b_

after:
CUDA_VISIBLE_DEVICES=0 python generate.py --base_model=h2oai/h2ogpt-oig-oasst1-512-6.9b --lora_weights=h2ogpt-oig-oasst1-512-6.9b.h2oaiopenassistant_oasst1_h2ogpt_only.1_epochs.97b9f2df6851e8b1c2f220a1028adad9029140bf.100 --prompt_type='human_bot' --chat=False --stream_output=False --gradio=False --eval_sharegpt_prompts_only=1000 --eval_sharegpt_as_output=False --num_beams=1 &> h2ogpt-oig-oasst1-512-6.9b.h2oaiopenassistant_oasst1_h2ogpt_only.1_epochs.97b9f2df6851e8b1c2f220a1028adad9029140bf.100.eval.log
h2ogpt-oig-oasst1-512-6.9b.h2oaiopenassistant_oasst1_h2ogpt.2_epochs.e35e2e06e0af2f7dceac2e16e3646c90ccce4ec0.1.eval.log

df_scores_1000_1000_1234_False_h2ogpt-oig-oasst1-512-6 9b_h2ogpt-oig-oasst1-512-6 9b h2oaiopenassistant_oasst1_h2ogpt_only 1_epochs 97b9f2df6851e8b1c2f220a1028adad9029140bf 100

@arnocandel
Copy link
Member Author

arnocandel commented Apr 22, 2023

give h2oai/h2ogpt-oasst1-512-6.9b personality

So obviously hurts too much to only hammer in the personality and nothing else, need to keep variety of fine-tuning data, so easiest for smaller models is to train a couple epochs on the full personalized dataset instead
https://huggingface.co/datasets/h2oai/openassistant_oasst1_h2ogpt

For larger models, can try to do some mixin mode, with small personality data + large mixin, but not all 80k rows. Note: didn't do that, just added 2 epochs on top of existing *512* models.

torchrun --nproc_per_node=2 finetune.py --base_model=h2oai/h2ogpt-oig-oasst1-512-6.9b --data_path=h2oai/openassistant_oasst1_h2ogpt --prompt_type=plain --run_id=1 --micro_batch_size=8 --batch_size=512 --cutoff_len=512 --num_epochs=2 &> log.1.txt

https://slack-files.com/T0329MHH6-F054GHUJJFM-eebaba5e98 lora weights and logs

https://huggingface.co/h2oai/h2ogpt-oig-oasst1-512-6.9b model card created by fcaae7e

@arnocandel
Copy link
Member Author

arnocandel commented Apr 22, 2023

CUDA_VISIBLE_DEVICES=0 python generate.py --base_model=h2oai/h2ogpt-oig-oasst1-512-6.9b --lora_weights=h2ogpt-oig-oasst1-512-6.9b.h2oaiopenassistant_oasst1_h2ogpt.2_epochs.e35e2e06e0af2f7dceac2e16e3646c90ccce4ec0.1 --prompt_type='human_bot' --chat=False --stream_output=False --gradio=False --eval_sharegpt_prompts_only=1000 --eval_sharegpt_as_output=False --num_beams=1 &> h2ogpt-oig-oasst1-512-6.9b.h2oaiopenassistant_oasst1_h2ogpt.2_epochs.e35e2e06e0af2f7dceac2e16e3646c90ccce4ec0.1.eval.log

df_scores_1000_1000_1234_False_h2ogpt-oig-oasst1-512-6 9b_h2ogpt-oig-oasst1-512-6 9b h2oaiopenassistant_oasst1_h2ogpt 2_epochs e35e2e06e0af2f7dceac2e16e3646c90ccce4ec0 1

@arnocandel
Copy link
Member Author

give h2oai/h2ogpt-oasst1-512-12b personality

continue #22 (comment)

torchrun --nproc_per_node=2 finetune.py --base_model=h2oai/h2ogpt-oasst1-512-12b --data_path=h2oai/openassistant_oasst1_h2ogpt --prompt_type=plain --run_id=2 --micro_batch_size=4 --batch_size=128 --cutoff_len=512 --num_epochs=2 &> log.2.txt

@arnocandel
Copy link
Member Author

arnocandel commented Apr 23, 2023

Comparing validation score on 1k ShareGPT before/after personality refresh

Before:
CUDA_VISIBLE_DEVICES=0,1 python generate.py --base_model=h2oai/h2ogpt-oasst1-512-12b --prompt_type='human_bot' --infer_devices=False --chat=False --stream_output=False --gradio=False --eval_sharegpt_prompts_only=1000 --eval_sharegpt_as_output=False --num_beams=1 &> h2ogpt-oasst1-512-12b.eval.log
h2ogpt-oasst1-512-12b.eval.log
df_scores_1000_1000_1234_False_h2ogpt-oasst1-512-12b_

After:
CUDA_VISIBLE_DEVICES=0,1 python generate.py --base_model=h2oai/h2ogpt-oasst1-512-12b --lora_weights=h2ogpt-oasst1-512-12b.h2oaiopenassistant_oasst1_h2ogpt.2_epochs.fcaae7ef70600de8c97c9b38cb3f0075467cdad1.2 --prompt_type='human_bot' --infer_devices=False --chat=False --stream_output=False --gradio=False --eval_sharegpt_prompts_only=1000 --eval_sharegpt_as_output=False --num_beams=1 &> h2ogpt-oasst1-512-12b.h2oaiopenassistant_oasst1_h2ogpt.2_epochs.fcaae7ef70600de8c97c9b38cb3f0075467cdad1.2.eval.log
h2ogpt-oasst1-512-12b.h2oaiopenassistant_oasst1_h2ogpt.2_epochs.fcaae7ef70600de8c97c9b38cb3f0075467cdad1.2.eval.log
df_scores_1000_1000_1234_False_h2ogpt-oasst1-512-12b_h2ogpt-oasst1-512-12b h2oaiopenassistant_oasst1_h2ogpt 2_epochs fcaae7ef70600de8c97c9b38cb3f0075467cdad1 2

@arnocandel
Copy link
Member Author

arnocandel commented Apr 23, 2023

give h2oai/h2ogpt-oasst1-512-20b personality

torchrun --nproc_per_node=8 finetune.py --base_model=h2oai/h2ogpt-oasst1-512-20b --data_path=h2oai/openassistant_oasst1_h2ogpt --prompt_type=plain --run_id=3 --micro_batch_size=4 --batch_size=128 --cutoff_len=512 --num_epochs=2 &> log.3.txt

https://slack-files.com/T0329MHH6-F054HBLG2LB-7a39e222f8 lora weights and logs

h2oai/h2ogpt-oasst1-512-20b e0202c5

@arnocandel
Copy link
Member Author

dcb56af

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant