beomi/KoAlpaca-v1.1a
Viewer β’ Updated β’ 21.2k β’ 949 β’ 62
How to use jin05102518/Astral-7B-Instruct-v0.01 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="jin05102518/Astral-7B-Instruct-v0.01")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("jin05102518/Astral-7B-Instruct-v0.01")
model = AutoModelForMultimodalLM.from_pretrained("jin05102518/Astral-7B-Instruct-v0.01")
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=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use jin05102518/Astral-7B-Instruct-v0.01 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "jin05102518/Astral-7B-Instruct-v0.01"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "jin05102518/Astral-7B-Instruct-v0.01",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/jin05102518/Astral-7B-Instruct-v0.01
How to use jin05102518/Astral-7B-Instruct-v0.01 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "jin05102518/Astral-7B-Instruct-v0.01" \
--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": "jin05102518/Astral-7B-Instruct-v0.01",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "jin05102518/Astral-7B-Instruct-v0.01" \
--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": "jin05102518/Astral-7B-Instruct-v0.01",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use jin05102518/Astral-7B-Instruct-v0.01 with Docker Model Runner:
docker model run hf.co/jin05102518/Astral-7B-Instruct-v0.01
docker model run hf.co/jin05102518/Astral-7B-Instruct-v0.01μμ΄ Instruct λ°μ΄ν°μ μ μ¬μ©νκ³ νκ΅μ΄ λ°μ΄ν°μ μ μ€μ§ KoAlpaca-v1.1a λ°μ΄ν°μ λ§μ Full-FinetuneμΌλ‘ νμ΅ν Mistral λͺ¨λΈμ λλ€.
prompt = "<|system|>\n</s>\n<|user|>\nμΏ λ²λ€ν°μ€μ λν΄ μλ €μ€</s>"
<s> <|system|>
</s>
<|user|>
μΏ λ²λ€ν°μ€μ λν΄ μ€λͺ
ν΄ μ€</s>
<|assistant|>
μΏ λ²λ€ν°μ€λ 컨ν
μ΄λλ₯Ό κ΄λ¦¬νλ μ€νμμ€ μμ€ν
μ
λλ€. μΏ λ²λ€ν°μ€λ 컨ν
μ΄λλ₯Ό μ€ννκ³ , 컨ν
μ΄λκ° μ€νλλ νκ²½μ μ 곡ν©λλ€. μΏ λ²λ€ν°μ€λ μ¬λ¬ κ°μ νΈμ€νΈ μ»΄ν¨ν°λ₯Ό κ΄λ¦¬νλ©°, μ΄λ¬ν νΈμ€νΈ μ»΄ν¨ν°λ₯Ό ν΅ν΄ 컨ν
μ΄λλ₯Ό μ€νν μ μμ΅λλ€. μΏ λ²λ€ν°μ€λ 컨ν
μ΄λλ₯Ό λ°°μΉνκ³ κ΄λ¦¬νλ κΈ°λ₯μ μ 곡ν©λλ€. λν, μΏ λ²λ€ν°μ€λ μλΉμ€ λ©μ¬, μ€ν 리μ§, λ°°μΉ μ»¨νΈλ‘€ νλ¬κ·ΈμΈ λ± λ€μν κΈ°λ₯μ μ 곡ν©λλ€. μ΄λ¬ν κΈ°λ₯λ€μ λͺ¨λ 컨ν
μ΄λλ₯Ό κ΄λ¦¬νκ³ λ°°μΉνλλ° μ μ©νλ©°, μΏ λ²λ€ν°μ€λ μ΄λ¬ν κΈ°λ₯λ€μ ν΅ν΄ 컨ν
μ΄λλ₯Ό ν¨κ³Όμ μΌλ‘ κ΄λ¦¬νκ³ λ°°μΉν μ μλ μμ€ν
μΌλ‘ μ리 μ‘κ³ μμ΅λλ€.</s>
<|user|>
μμ μ€λͺ
μ μμ΄λ‘ λ²μν΄ μ€</s>
<|assistant|>
Kubernetes is an open-source system for container management. Kubernetes manages the containers, and provides the environment for running the containers. Kubernetes manages multiple hosts, and runs the containers on these hosts. Kubernetes is a system for deploying and managing containers. Kubernetes also provides features such as service mesh, storage, and deployment control plugins. All of these features are useful for managing and deploying containers. Kubernetes is a system that effectively manages containers and deploys them efficiently.</s>
ν΄λΉ λͺ¨λΈμ μνμ μ΄λ©° κΈ°μ μ μνμ μν΄ μΌμμ μΌλ‘ λ§λ€μ΄μ‘μ΅λλ€.
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "jin05102518/Astral-7B-Instruct-v0.01"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jin05102518/Astral-7B-Instruct-v0.01", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'