beomi/KoAlpaca-v1.1a
Viewer • Updated • 21.2k • 1.04k • 62
How to use Edentns/DataVortexS-10.7B-v0.2 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Edentns/DataVortexS-10.7B-v0.2")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("Edentns/DataVortexS-10.7B-v0.2")
model = AutoModelForMultimodalLM.from_pretrained("Edentns/DataVortexS-10.7B-v0.2")
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 Edentns/DataVortexS-10.7B-v0.2 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Edentns/DataVortexS-10.7B-v0.2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Edentns/DataVortexS-10.7B-v0.2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Edentns/DataVortexS-10.7B-v0.2
How to use Edentns/DataVortexS-10.7B-v0.2 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Edentns/DataVortexS-10.7B-v0.2" \
--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": "Edentns/DataVortexS-10.7B-v0.2",
"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 "Edentns/DataVortexS-10.7B-v0.2" \
--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": "Edentns/DataVortexS-10.7B-v0.2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Edentns/DataVortexS-10.7B-v0.2 with Docker Model Runner:
docker model run hf.co/Edentns/DataVortexS-10.7B-v0.2
| Research & Engineering | Product Management |
|---|---|
| Kwangseok Yang | Seunghyun Choi |
| Jeongwon Choi | Hyoseok Choi |
It follows Alpaca format.
E.g.
text = """\
당신은 사람들이 정보를 찾을 수 있도록 도와주는 인공지능 비서입니다.
### Instruction:
대한민국의 수도는 어디야?
### Response:
대한민국의 수도는 서울입니다.
### Instruction:
서울 인구는 총 몇 명이야?
"""
| Task | 0-shot | 5-shot | 10-shot | 50-shot |
|---|---|---|---|---|
| kobest_boolq | 0.501449 | 0.668845 | 0.652565 | 0.655491 |
| kobest_copa | 0.635474 | 0.685637 | 0.708601 | 0.725683 |
| kobest_hellaswag | 0.417966 | 0.442942 | 0.428077 | 0.425199 |
| kobest_sentineg | 0.681941 | 0.880517 | 0.921754 | 0.939528 |
| Average | 0.5592075 | 0.66948525 | 0.67774925 | 0.68647525 |
| Average | Ko-ARC | Ko-HellaSwag | Ko-MMLU | Ko-TruthfulQA | Ko-CommonGen V2 |
|---|---|---|---|---|---|
| 43.6 | 38.74 | 50.74 | 38.98 | 44.7 | 44.86 |
This model contains the chat_template instruction format.
You can use the code below.
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto
model = AutoModelForCausalLM.from_pretrained("Edentns/DataVortexS-10.7B-v0.2")
tokenizer = AutoTokenizer.from_pretrained("Edentns/DataVortexS-10.7B-v0.2")
messages = [
{"role": "system", "content": "당신은 사람들이 정보를 찾을 수 있도록 도와주는 인공지능 비서입니다."},
{"role": "user", "content": "대한민국의 수도는 어디야?"},
{"role": "assistant", "content": "대한민국의 수도는 서울입니다."},
{"role": "user", "content": "서울 인구는 총 몇 명이야?"}
]
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
model_inputs = encodeds.to(device)
model.to(device)
generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
The model is licensed under the cc-by-nc-sa-4.0 license, which allows others to copy, modify, and share the work non-commercially, as long as they give appropriate credit and distribute any derivative works under the same license.