Instructions to use quantumaikr/KoreanLM-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use quantumaikr/KoreanLM-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="quantumaikr/KoreanLM-3B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("quantumaikr/KoreanLM-3B") model = AutoModelForCausalLM.from_pretrained("quantumaikr/KoreanLM-3B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use quantumaikr/KoreanLM-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "quantumaikr/KoreanLM-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "quantumaikr/KoreanLM-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/quantumaikr/KoreanLM-3B
- SGLang
How to use quantumaikr/KoreanLM-3B 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 "quantumaikr/KoreanLM-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "quantumaikr/KoreanLM-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "quantumaikr/KoreanLM-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "quantumaikr/KoreanLM-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use quantumaikr/KoreanLM-3B with Docker Model Runner:
docker model run hf.co/quantumaikr/KoreanLM-3B
KoreanLM: ํ๊ตญ์ด ์ธ์ด๋ชจ๋ธ ํ๋ก์ ํธ
KoreanLM์ ํ๊ตญ์ด ์ธ์ด๋ชจ๋ธ์ ๊ฐ๋ฐํ๊ธฐ ์ํ ์คํ์์ค ํ๋ก์ ํธ์ ๋๋ค. ํ์ฌ ๋๋ถ๋ถ์ ์ธ์ด๋ชจ๋ธ๋ค์ ์์ด์ ์ด์ ์ ๋ง์ถ๊ณ ์์ด, ํ๊ตญ์ด์ ๋ํ ํ์ต์ด ์๋์ ์ผ๋ก ๋ถ์กฑํ๊ณ ํ ํฐํ ๊ณผ์ ์์ ๋นํจ์จ์ ์ธ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค. ์ด๋ฌํ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ณ ํ๊ตญ์ด์ ์ต์ ํ๋ ์ธ์ด๋ชจ๋ธ์ ์ ๊ณตํ๊ธฐ ์ํด KoreanLM ํ๋ก์ ํธ๋ฅผ ์์ํ๊ฒ ๋์์ต๋๋ค.
ํ๋ก์ ํธ ๋ชฉํ
ํ๊ตญ์ด์ ํนํ๋ ์ธ์ด๋ชจ๋ธ ๊ฐ๋ฐ: ํ๊ตญ์ด์ ๋ฌธ๋ฒ, ์ดํ, ๋ฌธํ์ ํน์ฑ์ ๋ฐ์ํ์ฌ ํ๊ตญ์ด๋ฅผ ๋ ์ ํํ๊ฒ ์ดํดํ๊ณ ์์ฑํ ์ ์๋ ์ธ์ด๋ชจ๋ธ์ ๊ฐ๋ฐํฉ๋๋ค.
ํจ์จ์ ์ธ ํ ํฐํ ๋ฐฉ์ ๋์ : ํ๊ตญ์ด ํ ์คํธ์ ํ ํฐํ ๊ณผ์ ์์ ํจ์จ์ ์ด๊ณ ์ ํํ ๋ถ์์ด ๊ฐ๋ฅํ ์๋ก์ด ํ ํฐํ ๋ฐฉ์์ ๋์ ํ์ฌ ์ธ์ด๋ชจ๋ธ์ ์ฑ๋ฅ์ ํฅ์์ํต๋๋ค.
๊ฑฐ๋ ์ธ์ด๋ชจ๋ธ์ ์ฌ์ฉ์ฑ ๊ฐ์ : ํ์ฌ ๊ฑฐ๋ํ ์ฌ์ด์ฆ์ ์ธ์ด๋ชจ๋ธ๋ค์ ๊ธฐ์ ์ด ์์ฌ์ ๋ฐ์ดํฐ๋ฅผ ํ์ธํ๋ํ๊ธฐ ์ด๋ ค์ด ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ํ๊ตญ์ด ์ธ์ด๋ชจ๋ธ์ ํฌ๊ธฐ๋ฅผ ์กฐ์ ํ์ฌ ์ฌ์ฉ์ฑ์ ๊ฐ์ ํ๊ณ , ์์ฐ์ด ์ฒ๋ฆฌ ์์ ์ ๋ ์ฝ๊ฒ ์ ์ฉํ ์ ์๋๋ก ํฉ๋๋ค.
์ฌ์ฉ ๋ฐฉ๋ฒ
๋ค์์ transformers ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ํตํด ๋ชจ๋ธ๊ณผ ํ ํฌ๋์ด์ ๋ฅผ ๋ก๋ฉํ๋ ์์ ์ ๋๋ค.
import transformers
model = transformers.AutoModelForCausalLM.from_pretrained("quantumaikr/KoreanLM-3B")
tokenizer = transformers.AutoTokenizer.from_pretrained("quantumaikr/KoreanLM-3B")
๊ธฐ์ ๋ฌธ์
- Downloads last month
- 149