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)
defgen(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)
defgen(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.
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
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License, under LLAMA 2 COMMUNITY LICENSE AGREEMENT
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 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:
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.