Views
No views yet
h2oai/h2ogpt-research-oig-oasst1-512-30b is a 30 billion parameter instruction-following large language model for research use only.torchrun --nproc_per_node=8 finetune.py --base_model=decapoda-research/llama-30b-hf --micro_batch_size=1 --batch_size=8 --cutoff_len=512 --num_epochs=2.0 --val_set_size=0 --eval_steps=100000 --save_steps=17000 --save_total_limit=20 --prompt_type=plain --save_code=True --train_8bit=False --run_id=llama30b_17 --llama_flash_attn=True --lora_r=64 --lora_target_modules=['q_proj', 'k_proj', 'v_proj', 'o_proj'] --learning_rate=2e-4 --lora_alpha=32 --drop_truncations=True --data_path=h2oai/h2ogpt-oig-oasst1-instruct-cleaned-v2 --data_mix_in_path=h2oai/openassistant_oasst1_h2ogpt --data_mix_in_factor=1.0 --data_mix_in_prompt_type=plain --data_mix_in_col_dict={'input': 'input'}
python generate.py --base_model=decapoda-research/llama-30b-hf --lora_weights=<lora_weights_path> --infer_devices=False python generate.pyhuman_bot because that is the way it was instruct fine-tuned.<lora_weights_path> is a directory of some name that contains the files in this HF model repository:1BASE_MODEL = 'decapoda-research/llama-30b-hf'
2LORA_WEIGHTS = '<lora_weights_path>'
3OUTPUT_NAME = "local_h2ogpt-research-oasst1-512-30b"<lora_weights_path> is same path that includes the files mentioned in last section.python export_hf_checkpoint.pytransformers library on a machine with GPUs, first make sure you have the transformers and accelerate libraries installed.1pip install transformers==4.28.1
2pip install accelerate==0.18.01import torch
2from transformers import pipeline
3
4generate_text = pipeline(model="local_h2ogpt-research-oasst1-512-30b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
5
6res = generate_text("Why is drinking water so healthy?", max_new_tokens=100)
7print(res[0]["generated_text"])trust_remote_code=True you can download instruct_pipeline.py and stopping.py,
store it alongside your notebook, and construct the pipeline yourself from the loaded model and tokenizer:1import torch
2from h2oai_pipeline import H2OTextGenerationPipeline
3from transformers import AutoModelForCausalLM, AutoTokenizer
4
5tokenizer = AutoTokenizer.from_pretrained("local_h2ogpt-research-oasst1-512-30b", padding_side="left")
6model = AutoModelForCausalLM.from_pretrained("local_h2ogpt-research-oasst1-512-30b", torch_dtype=torch.bfloat16, device_map="auto")
7generate_text = H2OTextGenerationPipeline(model=model, tokenizer=tokenizer)
8
9res = generate_text("Why is drinking water so healthy?", max_new_tokens=100)
10print(res[0]["generated_text"])PeftModelForCausalLM(
(base_model): LoraModel(
(model): LlamaForCausalLM(
(model): LlamaModel(
(embed_tokens): Embedding(32000, 6656, padding_idx=31999)
(layers): ModuleList(
(0-59): 60 x LlamaDecoderLayer(
(self_attn): LlamaAttention(
(q_proj): Linear(
in_features=6656, out_features=6656, bias=False
(lora_dropout): ModuleDict(
(default): Dropout(p=0.05, inplace=False)
)
(lora_A): ModuleDict(
(default): Linear(in_features=6656, out_features=64, bias=False)
)
(lora_B): ModuleDict(
(default): Linear(in_features=64, out_features=6656, bias=False)
)
)
(k_proj): Linear(
in_features=6656, out_features=6656, bias=False
(lora_dropout): ModuleDict(
(default): Dropout(p=0.05, inplace=False)
)
(lora_A): ModuleDict(
(default): Linear(in_features=6656, out_features=64, bias=False)
)
(lora_B): ModuleDict(
(default): Linear(in_features=64, out_features=6656, bias=False)
)
)
(v_proj): Linear(
in_features=6656, out_features=6656, bias=False
(lora_dropout): ModuleDict(
(default): Dropout(p=0.05, inplace=False)
)
(lora_A): ModuleDict(
(default): Linear(in_features=6656, out_features=64, bias=False)
)
(lora_B): ModuleDict(
(default): Linear(in_features=64, out_features=6656, bias=False)
)
)
(o_proj): Linear(
in_features=6656, out_features=6656, bias=False
(lora_dropout): ModuleDict(
(default): Dropout(p=0.05, inplace=False)
)
(lora_A): ModuleDict(
(default): Linear(in_features=6656, out_features=64, bias=False)
)
(lora_B): ModuleDict(
(default): Linear(in_features=64, out_features=6656, bias=False)
)
)
(rotary_emb): LlamaRotaryEmbedding()
)
(mlp): LlamaMLP(
(gate_proj): Linear(in_features=6656, out_features=17920, bias=False)
(down_proj): Linear(in_features=17920, out_features=6656, bias=False)
(up_proj): Linear(in_features=6656, out_features=17920, bias=False)
(act_fn): SiLUActivation()
)
(input_layernorm): LlamaRMSNorm()
(post_attention_layernorm): LlamaRMSNorm()
)
)
(norm): LlamaRMSNorm()
)
(lm_head): Linear(in_features=6656, out_features=32000, bias=False)
)
)
)
trainable params: 204472320 || all params: 32733415936 || trainable%: 0.62465927906754961{
2 "base_model_name_or_path": "decapoda-research/llama-30b-hf",
3 "bias": "none",
4 "fan_in_fan_out": false,
5 "inference_mode": true,
6 "init_lora_weights": true,
7 "lora_alpha": 32,
8 "lora_dropout": 0.05,
9 "modules_to_save": null,
10 "peft_type": "LORA",
11 "r": 64,
12 "target_modules": [
13 "q_proj",
14 "k_proj",
15 "v_proj",
16 "o_proj"
17 ],
18 "task_type": "CAUSAL_LM"python generate.py --base_model=decapoda-research/llama-30b-hf --gradio=False --infer_devices=False --eval_sharegpt_prompts_only=100 --eval_sharegpt_as_output=False --lora_weights=llama-30b-hf.h2oaih2ogpt-oig-oasst1-instruct-cleaned-v2.2.0_epochs.131f6d098b43236b5f91e76fc074ad089d6df368.llama30b_17| Model | RLHF Mean Score | RLHF Median Score |
|---|---|---|
| h2oai/h2ogpt-research-oig-oasst1-512-30b | 0.55 | 0.58 |
| OpenAssistant/oasst-sft-7-llama-30b-xor | 0.51 | 0.48 |
| h2oai/h2ogpt-oasst1-512-20b | 0.49 | 0.48 |
| h2oai/h2ogpt-gm-oasst1-en-1024-20b | 0.43 | 0.38 |
| databricks/dolly-v2-12b | 0.37 | 0.27 |


python generate.py --base_model=h2oai/h2ogpt-oasst1-512-20b --gradio=False --infer_devices=False --eval_sharegpt_prompts_only=100 --eval_sharegpt_as_output=False --num_beams=2 &> score_h2ogpt-oasst1-512-20b_a.log
python generate.py --base_model=h2oai/h2ogpt-gm-oasst1-en-1024-20b --gradio=False --infer_devices=False --eval_sharegpt_prompts_only=100 --eval_sharegpt_as_output=False --num_beams=2 &> score_h2ogpt-gm-oasst1-en-1024-20b_a.log