Instructions to use SungJoo/llama3-8b-instruct-orpo-ko with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SungJoo/llama3-8b-instruct-orpo-ko with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SungJoo/llama3-8b-instruct-orpo-ko") 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("SungJoo/llama3-8b-instruct-orpo-ko") model = AutoModelForCausalLM.from_pretrained("SungJoo/llama3-8b-instruct-orpo-ko", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SungJoo/llama3-8b-instruct-orpo-ko with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SungJoo/llama3-8b-instruct-orpo-ko" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SungJoo/llama3-8b-instruct-orpo-ko", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SungJoo/llama3-8b-instruct-orpo-ko
- SGLang
How to use SungJoo/llama3-8b-instruct-orpo-ko 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 "SungJoo/llama3-8b-instruct-orpo-ko" \ --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": "SungJoo/llama3-8b-instruct-orpo-ko", "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 "SungJoo/llama3-8b-instruct-orpo-ko" \ --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": "SungJoo/llama3-8b-instruct-orpo-ko", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SungJoo/llama3-8b-instruct-orpo-ko with Docker Model Runner:
docker model run hf.co/SungJoo/llama3-8b-instruct-orpo-ko
Model Card for llama3-8b-instruct-orpo-ko
Model Summary
This model is a fine-tuned version of the meta-llama/Meta-Llama-3-8B-Instruct using the odds ratio preference optimization (ORPO).
It has been trained to perform NLP tasks in Korean.
Model Details
Model Description
- Developed by: Sungjoo Byun (Grace Byun)
- Language(s) (NLP): Korean
- License: Apache 2.0
- Finetuned from model: meta-llama/Meta-Llama-3-8B-Instruct
Training Details
Training Data
The model was trained using the dataset heegyu/hh-rlhf-ko. We appreciate heegyu for sharing this valuable resource.
Training Procedure
We applied ORPO β to llama3-8b-instruct. The training was conducted on an A100 GPU with 80GB of memory.
How to Get Started with the Model
Use the code below to get started with the model:
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("SungJoo/llama3-8b-instruct-orpo-ko")
model = AutoModelForCausalLM.from_pretrained("SungJoo/llama3-8b-instruct-orpo-ko")
Citations
Please cite the ORPO paper and our model as follows:
@misc{hong2024orpo,
title={ORPO: Monolithic Preference Optimization without Reference Model},
author={Jiwoo Hong and Noah Lee and James Thorne},
year={2024},
eprint={2403.07691},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@misc{byun,
author = {Sungjoo Byun},
title = {llama3-8b-orpo-ko},
year = {2024},
publisher = {Hugging Face},
journal = {Hugging Face repository},
howpublished = {\url{https://huggingface.co/SungJoo/llama3-8b-instruct-orpo-ko}}
}
Contact
For any questions or issues, please contact byunsj@snu.ac.kr.
- Downloads last month
- 10