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

Support OpenAssistant models in basic form, including 30B xor one #119

Merged
merged 1 commit into from
May 7, 2023

Conversation

pseudotensor
Copy link
Collaborator

@pseudotensor pseudotensor commented May 7, 2023

Follow: https://huggingface.co/OpenAssistant/oasst-sft-7-llama-30b-xor

and add prompt_type stuff. bit hacky in dealing with special chars.

@pseudotensor pseudotensor marked this pull request as ready for review May 7, 2023 09:55
@pseudotensor pseudotensor force-pushed the oasst_support branch 2 times, most recently from 4aadfe3 to c5761bd Compare May 7, 2023 09:57
Follow: https://huggingface.co/OpenAssistant/oasst-sft-7-llama-30b-xor

source ~/.bashrc.mamba
mamba create -n oasstllamahf
conda activate oasstllamahf
mamba install python==3.10
mkdir oasstllamahf
cd oasstllamahf
git clone https://github.com/huggingface/transformers.git
cd transformers
git checkout d04ec99bec8a0b432fc03ed60cea9a1a20ebaf3c
pip install .
pip install torch==1.13.1 accelerate==0.18.0 sentencepiece==0.1.98 protobuf==3.20.1
pip freeze  # check
python src/transformers/models/llama/convert_llama_weights_to_hf.py --input_dir /data/jon/LLaMA  --output_dir LLaMA30B --model_size 30B
python
> from huggingface_hub import snapshot_download
> snapshot_download("OpenAssistant/oasst-sft-7-llama-30b-xor")
> exit()
ls -arlt ~/.cache/huggingface/hub/models--OpenAssistant--oasst-sft-7-llama-30b-xor/snapshots/d31b76426385f683c6efb8d4daea58379fb9bb09/oasst-sft-7-llama-30b-xor/  # check
ls -alrt LLaMA30B/  # check
find LLaMA30B -type f | xargs md5sum  # check
oadir=~/.cache/huggingface/hub/models--OpenAssistant--oasst-sft-7-llama-30b-xor/snapshots/d31b76426385f683c6efb8d4daea58379fb9bb09
python $oadir/xor_codec.py oasst-sft-7-llama-30b/ $oadir/oasst-sft-7-llama-30b-xor/ LLaMA30B
ls -alrt oasst-sft-7-llama-30b/ # check
cd ~/h2ogpt/
ln -s <location of oasst-sft-7-llama-30b> .
@pseudotensor
Copy link
Collaborator Author

eval on OASST 30B 7sft:

CUDA_VISIBLE_DEVICES="0,1" python generate.py --base_model=oasst-sft-7-llama-30b --gradio=False --infer_devices=False --eval_sharegpt_prompts_only=100 --eval_sharegpt_as_output=False --num_beams=2 &> score_oasst30b_xor_7sft_a.log

@pseudotensor pseudotensor marked this pull request as draft May 7, 2023 10:17
@pseudotensor
Copy link
Collaborator Author

Unsure why this:

START====================================================================================================
Question: Can you write a blog post about how AI is helping video productions with their storyboards? Include a brief summary of what storyboards are and how they help a production. Specifically mention that AI image generators can
 help spur imagination when creating storyboards 
---------------------------------------------------------------------------------------------------------
{'instruction': '', 'iinput': '', 'context': '', 'stream_output': False, 'prompt_type': 'open_assistant', 'temperature': 0.1, 'top_p': 0.75, 'top_k': 40, 'num_beams': 2, 'max_new_tokens': 256, 'min_new_tokens': 0, 'early_stopping':
 False, 'max_time': 180, 'repetition_penalty': 1.07, 'num_return_sequences': 1, 'do_sample': False, 'chat': False, 'instruction_nochat': 'Can you write a blog post about how AI is helping video productions with their storyboards? I
nclude a brief summary of what storyboards are and how they help a production. Specifically mention that AI image generators can help spur imagination when creating storyboards', 'iinput_nochat': '', 'src_lang': None, 'tgt_lang': N
one, 'debug': True, 'concurrency_count': 1, 'save_dir': None, 'sanitize_bot_response': True, 'is_low_mem': False, 'raise_generate_gpu_exceptions': True, 'chat_context': False, 'lora_weights': ''}
prompt:  <|prompter|>Can you write a blog post about how AI is helping video productions with their storyboards? Include a brief summary of what storyboards are and how they help a production. Specifically mention that AI image gen
erators can help spur imagination when creating storyboards
<|assistant|>
input_ids length 57
Pre-Generate: 2023-05-07 03:16:28.247373
Generate: 2023-05-07 03:16:28.247408
output:
 <unk> <|prompter|> Can you write a blog post about how AI is helping video productions with their storyboards? Include a brief summary of what storyboards are and how they help a production. Specifically mention that AI image gene
rators can help spur imagination when creating storyboards <|assistant|> </s>
outputclean:
 

SCORE 0: 0.27503237
Post-Generate: 2023-05-07 03:17:26.688891 decoded_output: 302

0.3 score even though no response. And why no response? Just <\s>

@pseudotensor pseudotensor marked this pull request as ready for review May 7, 2023 20:58
@pseudotensor pseudotensor merged commit be9cbb2 into main May 7, 2023
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

Successfully merging this pull request may close these issues.

1 participant