maywell/korean_textbooks
Viewer β’ Updated β’ 4.42M β’ 1.12k β’ 124
How to use heegyu/ko-llama-46M-v0 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="heegyu/ko-llama-46M-v0") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("heegyu/ko-llama-46M-v0")
model = AutoModelForCausalLM.from_pretrained("heegyu/ko-llama-46M-v0", device_map="auto")How to use heegyu/ko-llama-46M-v0 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "heegyu/ko-llama-46M-v0"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "heegyu/ko-llama-46M-v0",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/heegyu/ko-llama-46M-v0
How to use heegyu/ko-llama-46M-v0 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "heegyu/ko-llama-46M-v0" \
--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": "heegyu/ko-llama-46M-v0",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "heegyu/ko-llama-46M-v0" \
--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": "heegyu/ko-llama-46M-v0",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use heegyu/ko-llama-46M-v0 with Docker Model Runner:
docker model run hf.co/heegyu/ko-llama-46M-v0
from transformers import pipeline
pipe = pipeline("text-generation", model="heegyu/ko-llama-46M-v0")
print(pipe("μλ
νμΈμ", do_sample=True, max_new_tokens=120, top_k=50, top_p=0.7)[0]['generated_text'])
μ€ν κ²°κ³Ό
μλ
νμΈμ, μ¬λ¬λΆ. μ€λμ μ€λ κ°μμμ, νλͺ
μ μΈ λ λͺ¬λμμ λ°κ²¬λ νμμ κ²½νμ λν΄ μ΄μΌκΈ°νκ³ μΆμ΅λλ€. μ΄ κ°μλ ν
λ λΉμ μ νλͺ
κ³Ό κ°μ μλμ νκ°λ€μ κ²½κ΄μ μΈ κ²½νμ λν λ―Ώμ, κ·Έλ¦¬κ³ κ·Έκ²μ΄ μ€λμ λ―Έμ μ μ£Όμ νμμ κ²½νμ κΈ°μ¬νλ λ° μ€μ μ λ‘λλ€.
λ¨Όμ , νλͺ
μ μΈ λ λͺ¬λμμ μμλ λ λͺ¬λμμ μκ°λ μ£Όμ κ΅νλ λ°λ‘ νλͺ
μ λν νλͺ
μ μΈ κ΄μ μ
λλ€. λΉμ μ λ½μ μ리μ νλͺ
μ ν
λ λΉμ μ μκΈ°μμ΅λλ€
pipe("μ¬λλ€μ", do_sample=True, max_new_tokens=120, top_k=50, top_p=0.7)[0]['generated_text']
μ¬λλ€μ λ λ§μ μ΄μ μ μ»μ μ μλ€κ³ μκ°ν©λλ€.
**Epsilon:** μ λ λμνμ§ μμ΅λλ€. κ³Όνμ λͺ¨λ κ²μ μ€λͺ
ν μ μμ΅λλ€. κ³Όνμ μ°λ¦¬κ° κ²½ννλ λͺ¨λ κ²μ κ·Όλ³Έμ μΈ μμ±μ
λλ€.
**Phi:** νμ§λ§ κ³Όνμ μ°λ¦¬κ° κ²½ννλ λͺ¨λ κ²μ κ·Όλ³Έμ μΈ μμ±μ
λλ€. μ°λ¦¬κ° μΈμμ κ²½ννλ λ°©μμ μ°λ¦¬μ λμ 물리μ ꡬ쑰λ₯Ό μ€λͺ
ν©λλ€.
**Epsilon:** κ·Έλ¬λ κ·Έκ²μ λ¨μ§ μΆμΈ‘μΌ λΏμ
λλ€. μ°λ¦¬λ κ³Όνμ΄ μ΄λ»κ² μ¬μ©λ μ§ μ μ μμ΅λλ€.
**Phi:** κ·Έλ λλΌλ κ³Όνμ μ°λ¦¬μ λ§μκ³Ό λ§μμ μ€λͺ
ν