beomi / llama-2-ko-70b

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: November 03 2023
text-generation

Introduction of llama-2-ko-70b

Model Details of llama-2-ko-70b

🚧 Note: this repo is under construction 🚧

Llama-2-Ko 🦙🇰🇷

Llama-2-Ko serves as an advanced iteration of Llama 2, benefiting from an expanded vocabulary and the inclusion of a Korean corpus in its further pretraining. Just like its predecessor, Llama-2-Ko operates within the broad range of generative text models that stretch from 7 billion to 70 billion parameters. This repository focuses on the 70B pretrained version, which is tailored to fit the Hugging Face Transformers format. For access to the other models, feel free to consult the index provided below.

Model Details

Model Developers Junbum Lee (Beomi)

Variations Llama-2-Ko will come in a range of parameter sizes — 7B, 13B, and 70B — as well as pretrained and fine-tuned variations.

Input Models input text only.

Output Models generate text only.

Usage

Use with 8bit inference

  • Requires > 74GB vram (compatible with 4x RTX 3090/4090 or 1x A100/H100 80G or 2x RTX 6000 ada/A6000 48G)
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline

model_8bit = AutoModelForCausalLM.from_pretrained(
    "beomi/llama-2-ko-70b", 
    load_in_8bit=True,
    device_map="auto",
)
tk = AutoTokenizer.from_pretrained('beomi/llama-2-ko-70b')
pipe = pipeline('text-generation', model=model_8bit, tokenizer=tk)

def gen(x):
    gended = pipe(f"### Title: {x}\n\n### Contents:",  # Since it this model is NOT finetuned with Instruction dataset, it is NOT optimal prompt.
        max_new_tokens=300,
        top_p=0.95,
        do_sample=True,
    )[0]['generated_text']
    print(len(gended))
    print(gended)

Use with bf16 inference

  • Requires > 150GB vram (compatible with 8x RTX 3090/4090 or 2x A100/H100 80G or 4x RTX 6000 ada/A6000 48G)
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline

model = AutoModelForCausalLM.from_pretrained(
    "beomi/llama-2-ko-70b", 
    device_map="auto",
)
tk = AutoTokenizer.from_pretrained('beomi/llama-2-ko-70b')
pipe = pipeline('text-generation', model=model, tokenizer=tk)

def gen(x):
    gended = pipe(f"### Title: {x}\n\n### Contents:",  # Since it this model is NOT finetuned with Instruction dataset, it is NOT optimal prompt.
        max_new_tokens=300,
        top_p=0.95,
        do_sample=True,
    )[0]['generated_text']
    print(len(gended))
    print(gended)

Model Architecture

Llama-2-Ko is an auto-regressive language model that uses an optimized transformer architecture based on Llama-2.

Training Data Params Content Length GQA Tokens LR
Llama-2-Ko 70B A new mix of Korean online data 70B 4k >20B 1e -5
*Plan to train upto 300B tokens

Vocab Expansion

Model Name Vocabulary Size Description
Original Llama-2 32000 Sentencepiece BPE
Expanded Llama-2-Ko 46592 Sentencepiece BPE. Added Korean vocab and merges
*Note: Llama-2-Ko 70B uses 46592 not 46336 (7B), will update new 7B model soon.

Tokenizing "안녕하세요, 오늘은 날씨가 좋네요. ㅎㅎ"

Model Tokens
Llama-2 ['▁', '안', '<0xEB>', '<0x85>', '<0x95>', '하', '세', '요', ',', '▁', '오', '<0xEB>', '<0x8A>', '<0x98>', '은', '▁', '<0xEB>', '<0x82>', '<0xA0>', '씨', '가', '▁', '<0xEC>', '<0xA2>', '<0x8B>', '<0xEB>', '<0x84>', '<0xA4>', '요', '.', '▁', '<0xE3>', '<0x85>', '<0x8E>', '<0xE3>', '<0x85>', '<0x8E>']
Llama-2-Ko *70B ['▁안녕', '하세요', ',', '▁오늘은', '▁날', '씨가', '▁좋네요', '.', '▁', 'ㅎ', 'ㅎ']

Tokenizing "Llama 2: Open Foundation and Fine-Tuned Chat Models"

Model Tokens
Llama-2 ['▁L', 'l', 'ama', '▁', '2', ':', '▁Open', '▁Foundation', '▁and', '▁Fine', '-', 'T', 'un', 'ed', '▁Ch', 'at', '▁Mod', 'els']
Llama-2-Ko 70B ['▁L', 'l', 'ama', '▁', '2', ':', '▁Open', '▁Foundation', '▁and', '▁Fine', '-', 'T', 'un', 'ed', '▁Ch', 'at', '▁Mod', 'els']

Model Benchmark

LM Eval Harness - Korean (polyglot branch)
TBD
Note for oobabooga/text-generation-webui

Remove ValueError at load_tokenizer function(line 109 or near), in modules/models.py .

diff --git a/modules/models.py b/modules/models.py
index 232d5fa..de5b7a0 100644
--- a/modules/models.py
+++ b/modules/models.py
@@ -106,7 +106,7 @@ def load_tokenizer(model_name, model):
                 trust_remote_code=shared.args.trust_remote_code,
                 use_fast=False
             )
-        except ValueError:
+        except:
             tokenizer = AutoTokenizer.from_pretrained(
                 path_to_model,
                 trust_remote_code=shared.args.trust_remote_code,

Since Llama-2-Ko uses FastTokenizer provided by HF tokenizers NOT sentencepiece package, it is required to use use_fast=True option when initialize tokenizer.

Apple Sillicon does not support BF16 computing, use CPU instead. (BF16 is supported when using NVIDIA GPU)

LICENSE
Citation
@misc {l._junbum_2023,
    author       = { {L. Junbum} },
    title        = { llama-2-ko-70b },
    year         = 2023,
    url          = { https://huggingface.co/beomi/llama-2-ko-70b },
    doi          = { 10.57967/hf/1130 },
    publisher    = { Hugging Face }
}
Acknowledgement

The training is supported by TPU Research Cloud program.

Runs of beomi llama-2-ko-70b on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About llama-2-ko-70b huggingface.co Model

More llama-2-ko-70b license Visit here:

https://choosealicense.com/licenses/cc-by-nc-sa-4.0

llama-2-ko-70b huggingface.co

llama-2-ko-70b huggingface.co is an AI model on huggingface.co that provides llama-2-ko-70b's model effect (), which can be used instantly with this beomi llama-2-ko-70b model. huggingface.co supports a free trial of the llama-2-ko-70b model, and also provides paid use of the llama-2-ko-70b. Support call llama-2-ko-70b model through api, including Node.js, Python, http.

llama-2-ko-70b huggingface.co Url

https://huggingface.co/beomi/llama-2-ko-70b

beomi llama-2-ko-70b online free

llama-2-ko-70b huggingface.co is an online trial and call api platform, which integrates llama-2-ko-70b's modeling effects, including api services, and provides a free online trial of llama-2-ko-70b, you can try llama-2-ko-70b online for free by clicking the link below.

beomi llama-2-ko-70b online free url in huggingface.co:

https://huggingface.co/beomi/llama-2-ko-70b

llama-2-ko-70b install

llama-2-ko-70b is an open source model from GitHub that offers a free installation service, and any user can find llama-2-ko-70b on GitHub to install. At the same time, huggingface.co provides the effect of llama-2-ko-70b install, users can directly use llama-2-ko-70b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

llama-2-ko-70b install url in huggingface.co:

https://huggingface.co/beomi/llama-2-ko-70b

Url of llama-2-ko-70b

llama-2-ko-70b huggingface.co Url

Provider of llama-2-ko-70b huggingface.co

beomi
ORGANIZATIONS

Other API from beomi

huggingface.co

Total runs: 5.8K
Run Growth: 1.3K
Growth Rate: 23.10%
Updated:May 23 2024
huggingface.co

Total runs: 3.5K
Run Growth: -3.7K
Growth Rate: -108.20%
Updated:March 30 2023
huggingface.co

Total runs: 664
Run Growth: 360
Growth Rate: 54.14%
Updated:December 27 2023
huggingface.co

Total runs: 541
Run Growth: 362
Growth Rate: 67.66%
Updated:July 08 2024
huggingface.co

Total runs: 358
Run Growth: 164
Growth Rate: 46.59%
Updated:March 30 2023
huggingface.co

Total runs: 244
Run Growth: 233
Growth Rate: 96.68%
Updated:July 08 2024
huggingface.co

Total runs: 193
Run Growth: 107
Growth Rate: 54.04%
Updated:March 26 2024
huggingface.co

Total runs: 175
Run Growth: 87
Growth Rate: 51.48%
Updated:July 20 2023
huggingface.co

Total runs: 129
Run Growth: 63
Growth Rate: 50.00%
Updated:June 28 2023
huggingface.co

Total runs: 125
Run Growth: 10
Growth Rate: 8.26%
Updated:March 26 2024
huggingface.co

Total runs: 111
Run Growth: 34
Growth Rate: 31.19%
Updated:July 11 2023
huggingface.co

Total runs: 53
Run Growth: 23
Growth Rate: 44.23%
Updated:August 21 2024
huggingface.co

Total runs: 46
Run Growth: 28
Growth Rate: 70.00%
Updated:November 13 2023
huggingface.co

Total runs: 34
Run Growth: 22
Growth Rate: 66.67%
Updated:July 08 2024
huggingface.co

Total runs: 33
Run Growth: 21
Growth Rate: 63.64%
Updated:November 23 2021
huggingface.co

Total runs: 32
Run Growth: 26
Growth Rate: 81.25%
Updated:March 01 2022
huggingface.co

Total runs: 25
Run Growth: 13
Growth Rate: 52.00%
Updated:September 15 2023
huggingface.co

Total runs: 10
Run Growth: -7
Growth Rate: -70.00%
Updated:May 21 2021
huggingface.co

Total runs: 8
Run Growth: 4
Growth Rate: 50.00%
Updated:June 11 2021
huggingface.co

Total runs: 8
Run Growth: 3
Growth Rate: 37.50%
Updated:May 07 2023
huggingface.co

Total runs: 6
Run Growth: 1
Growth Rate: 16.67%
Updated:March 08 2023
huggingface.co

Total runs: 6
Run Growth: 0
Growth Rate: 0.00%
Updated:June 29 2023
huggingface.co

Total runs: 5
Run Growth: -5
Growth Rate: -100.00%
Updated:May 04 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 10 2022
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:June 10 2021