Text Generation
Transformers
Safetensors
English
Korean
llama
Llama3
meta
Easy Systems
conversational
text-generation-inference
Instructions to use Easy-Systems/easy-ko-Llama3-8b-Instruct-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Easy-Systems/easy-ko-Llama3-8b-Instruct-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Easy-Systems/easy-ko-Llama3-8b-Instruct-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Easy-Systems/easy-ko-Llama3-8b-Instruct-v1") model = AutoModelForCausalLM.from_pretrained("Easy-Systems/easy-ko-Llama3-8b-Instruct-v1", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Easy-Systems/easy-ko-Llama3-8b-Instruct-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Easy-Systems/easy-ko-Llama3-8b-Instruct-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Easy-Systems/easy-ko-Llama3-8b-Instruct-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Easy-Systems/easy-ko-Llama3-8b-Instruct-v1
- SGLang
How to use Easy-Systems/easy-ko-Llama3-8b-Instruct-v1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Easy-Systems/easy-ko-Llama3-8b-Instruct-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Easy-Systems/easy-ko-Llama3-8b-Instruct-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Easy-Systems/easy-ko-Llama3-8b-Instruct-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Easy-Systems/easy-ko-Llama3-8b-Instruct-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Easy-Systems/easy-ko-Llama3-8b-Instruct-v1 with Docker Model Runner:
docker model run hf.co/Easy-Systems/easy-ko-Llama3-8b-Instruct-v1
Easy-Systems/easy-ko-Llama3-8b-Instruct-v1
DALL-E로 생성한 이미지입니다.
- (주)이지시스템의 첫번째 LLM 모델인 easy-ko-Llama3-8b-Instruct-v1은 영어 기반 모델인 meta-llama/Meta-Llama-3-8B-Instruct를 베이스로 하여 한국어 파인튜닝 된 모델입니다.
- LLM 모델은 추후 지속적으로 업데이트 될 예정 입니다.
Data
- AI hub (https://www.aihub.or.kr/) 데이터를 다양한 Task (QA, Summary, Translate 등)로 가공하여 파인튜닝에 사용.
- 사내 자체 가공한 데이터를 활용하여 파인튜닝에 사용.
How to use
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Easy-Systems/easy-ko-Llama3-8b-Instruct-v1"
model = AutoModelForCausalLM.from_pretrained(model_id,
attn_implementation="flash_attention_2",
torch_dtype=torch.bfloat16,
device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_id, add_special_tokens=True)
prompt="리눅스 프로세스를 강제로 종료하는 방법은?"
messages = [
{"role": "system", "content": "당신은 친절한 AI chatbot 입니다. 요청에 대해서 step-by-step 으로 간결하게 한국어(Korean)로 답변해주세요."},
{"role": "user", "content": f"\n\n### 명령어: {prompt}\n\n### 응답:"}
]
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
terminators = [
tokenizer.eos_token_id,
tokenizer.convert_tokens_to_ids("<|eot_id|>")
]
outputs = model.generate(
input_ids,
max_new_tokens=1024,
eos_token_id=terminators,
pad_token_id=tokenizer.eos_token_id,
do_sample=True,
temperature=0.2,
repetition_penalty = 1.3,
top_p=0.9,
top_k=10,
)
response = outputs[0][input_ids.shape[-1]:]
print(tokenizer.decode(response, skip_special_tokens=True).strip())
Example Output
리눅스의 경우, `kill` 또는 `pkill` 명령을 사용하여 특정 프로세스를 강제로 종료할 수 있습니다.
1단계: ps -ef | grep <프로세스_이름>`으로 현재 실행 중인 모든 프로세스가 표시됩니다.
2단계: kill <프로세스_ID>`를 입력하면 해당 프로세스가 즉시 종료됩니다.
또는 `-9`(SIGKILL 신호)를 지정하여 프로세스를 강제로 종료하도록 할 수도 있으며, 이는 운영 체제에서 정상적으로 종료하기 전에 마지막 기회를 주지 않고 바로 죽게 됩니다:
3단계: kill -9 <프로세스_ID>`를 입력합니다.
참고로, 시스템의 안정을 위해 필요한 파일이나 서비스가 있는 경우에는 직접 삭제하지 말아야 하며, 적절한 권한과 지시에 따라 처리해야 합니다. 또한 일부 프로그램들은 강제종료 시 데이터 손실 등의 문제가 발생할 가능성이 있으므로 미리 저장된 작업 내용 등을 확인하고 종료하시기 바랍니다.
License
- Creative Commons Attribution-NonCommercial-ShareAlike 4.0 (CC-BY-NC-SA-4.0)
- 상업적 사용 시, 아래의 연락처로 문의해주시기 바랍니다.
Contact
- 상업적 사용 또는 기타 문의 사항에 대하여 연락하시려면 다음 이메일로 연락 주십시오.
- 강현구: hkkang@easy.co.kr
- Downloads last month
- 31