| --- |
| language: |
| - ko |
|
|
| library_name: transformers |
| pipeline_tag: text-generation |
| license: cc-by-nc-4.0 |
| --- |
| |
|
|
| # **V0.3 IS UP** |
|
|
| [Link to V0.3](https://huggingface.co/maywell/Synatra-7B-v0.3-base) |
|
|
| # **Synatra-V0.1-7B** |
|
|
| Made by StableFluffy |
|
|
| [Visit my website! - Currently on consturction..](https://www.stablefluffy.kr/) |
|
|
| ## License |
|
|
| This model is strictly [*non-commercial*](https://creativecommons.org/licenses/by-nc/4.0/) (**cc-by-nc-4.0**) use only which takes priority over the **LLAMA 2 COMMUNITY LICENSE AGREEMENT**. |
| The "Model" is completely free (ie. base model, derivates, merges/mixes) to use for non-commercial purposes as long as the the included **cc-by-nc-4.0** license in any parent repository, and the non-commercial use statute remains, regardless of other models' licences. |
| The licence can be changed after new model released. |
|
|
| ## Model Details |
| **Base Model** |
| [mistralai/Mistral-7B-Instruct-v0.1](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1) |
|
|
| **Trained On** |
| A6000 48GB * 8 |
|
|
| ## Instruction format |
|
|
| **ํ์ต ๊ณผ์ ์ ์ค์๋ก [/INST]๊ฐ ์๋ [\INST]๊ฐ ์ ์ฉ๋์์ต๋๋ค. v0.2 ์์ ์์ ๋ ์์ ์
๋๋ค.** |
|
|
| In order to leverage instruction fine-tuning, your prompt should be surrounded by `[INST]` and `[\INST]` tokens. The very first instruction should begin with a begin of sentence id. The next instructions should not. The assistant generation will be ended by the end-of-sentence token id. |
| Plus, It is strongly recommended to add a space at the end of the prompt. |
|
|
| E.g. |
| ``` |
| text = "<s>[INST] ์์ด์ ๋ดํด์ ์
์ ์ ์๋ ค์ค. [\INST] " |
| ``` |
|
|
| # **Model Benchmark** |
|
|
| ## KULLM Evaluation |
| ๊ตฌ๋ฆv2 repo ์์ ์ ๊ณต๋๋ ๋ฐ์ดํฐ์
๊ณผ ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํ์ฌ ํ๊ฐํ์ต๋๋ค. |
| ๋น์ GPT4์ ํ์ฌ GPT4๊ฐ ์์ ํ ๋์ผํ์ง๋ ์๊ธฐ์ ์ค์ ๊ฒฐ๊ณผ์ ์ฝ๊ฐ์ ์ฐจ์ด๊ฐ ์กด์ฌ ํ ์ ์์ต๋๋ค. |
|
|
|  |
| | Model | ์ดํด๊ฐ๋ฅ์ฑ | ์์ฐ์ค๋ฌ์ | ๋งฅ๋ฝ์ ์ง | ํฅ๋ฏธ๋ก์ | ์ง์์ด์ฌ์ฉ | ์ ๋ฐ์ ํ๋ฆฌํฐ |
| | --- | --- | --- | --- | --- | --- | --- |
| | GPT-3.5 | 0.980 | 2.806 | 2.849 | 2.056 | 0.917 | 3.905 |
| | GPT-4 | 0.984 | 2.897 | 2.944 | 2.143 | 0.968 | 4.083 |
| | KoAlpaca v1.1 | 0.651 | 1.909 | 1.901 | 1.583 | 0.385 | 2.575 |
| | koVicuna | 0.460 | 1.583 | 1.726 | 1.528 | 0.409 | 2.440 |
| | KULLM v2 | 0.742 | 2.083 | 2.107 | 1.794 | 0.548 | 3.036 |
| | **Synatra-V0.1-7B** | **0.960** | **2.821** | **2.755** | **2.356** | **0.934** | **4.065** |
|
|
| ## KOBEST_BOOLQ, SENTINEG, WIC - ZERO_SHOT |
| [EleutherAI/lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/polyglot)๋ฅผ ์ฌ์ฉํ์ฌ BoolQ, SentiNeg, Wic์ ์ธก์ ํ์ต๋๋ค. |
|
|
| HellaSwag์ COPA๋ ์๋ณธ์ฝ๋๋ฅผ ์์ ํ๋ ๊ณผ์ ์์ ์ด๋ ค์์ ๊ฒช์ด ์์ง ์งํํ์ง ์์์ต๋๋ค. |
|
|
| ### NOTE |
| BoolQ์๋ Instruction ๋ชจ๋ธ์ ์ดํด๋ฅผ ๋๊ธฐ์ํด "์ ๊ธ์ ๋ํ ์ง๋ฌธ์ ์ฌ์ค์ ํ์ธํ๋ ์์
์
๋๋ค.", "์, ์๋์ค๋ก ๋๋ตํด์ฃผ์ธ์."์ ํ๋กฌํํธ๋ฅผ ์ถ๊ฐํ์ต๋๋ค. |
| SentiNeg์๋ Instruction ๋ชจ๋ธ์ ์ดํด๋ฅผ ๋๊ธฐ์ํด "์ ๋ฌธ์ฅ์ ๊ธ์ , ๋ถ์ ์ฌ๋ถ๋ฅผ ํ๋จํ์ธ์."์ ํ๋กฌํํธ๋ฅผ ์ถ๊ฐํ์ต๋๋ค. |
| Wic์ ๊ฒฝ์ฐ๋ [INST], [\INST]๋ง ์ถ๊ฐํ์์ต๋๋ค. |
|
|
|
|
| | Model | COPA | HellaSwag | BoolQ | SentiNeg | Wic |
| | --- | --- | --- | --- | --- | --- |
| | EleutherAI/polyglot-ko-12.8b | 0.7937 | 0.5954 | 0.4818 | 0.9117 | 0.3985 |
| | **Synatra-V0.1-7B** | **NaN** | **NaN** | **0.849** | **0.8690** | **0.4881** |
|
|
| # **Implementation Code** |
|
|
| Since, chat_template already contains insturction format above. |
| You can use the code below. |
| |
| ```python |
| from transformers import AutoModelForCausalLM, AutoTokenizer |
| |
| device = "cuda" # the device to load the model onto |
| |
| model = AutoModelForCausalLM.from_pretrained("maywell/Synatra-V0.1-7B") |
| tokenizer = AutoTokenizer.from_pretrained("maywell/Synatra-V0.1-7B") |
| |
| messages = [ |
| {"role": "user", "content": "What is your favourite condiment?"}, |
| ] |
| |
| encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt") |
|
|
| model_inputs = encodeds.to(device) |
| model.to(device) |
| |
| generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True) |
| decoded = tokenizer.batch_decode(generated_ids) |
| print(decoded[0]) |
| ``` |
| |
| If you run it on oobabooga your prompt would look like this. - ** Need to add Space at the end! ** |
| ``` |
| [INST] ๋ง์ปจ์ ๋ํด์ ์๋ ค์ค. [\INST] |
| ``` |
| |
| > Readme format: [beomi/llama-2-ko-7b](https://huggingface.co/beomi/llama-2-ko-7b) |
| |
| --- |
| # [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) |
| Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_maywell__Synatra-V0.1-7B) |
| |
| | Metric | Value | |
| |-----------------------|---------------------------| |
| | Avg. | 53.54 | |
| | ARC (25-shot) | 55.29 | |
| | HellaSwag (10-shot) | 76.63 | |
| | MMLU (5-shot) | 55.29 | |
| | TruthfulQA (0-shot) | 55.76 | |
| | Winogrande (5-shot) | 72.77 | |
| | GSM8K (5-shot) | 19.41 | |
| | DROP (3-shot) | 39.63 | |
| |