Instructions to use CarrotAI/Carrot-Ko-2B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CarrotAI/Carrot-Ko-2B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CarrotAI/Carrot-Ko-2B-Instruct") 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("CarrotAI/Carrot-Ko-2B-Instruct") model = AutoModelForCausalLM.from_pretrained("CarrotAI/Carrot-Ko-2B-Instruct", 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 CarrotAI/Carrot-Ko-2B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CarrotAI/Carrot-Ko-2B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CarrotAI/Carrot-Ko-2B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CarrotAI/Carrot-Ko-2B-Instruct
- SGLang
How to use CarrotAI/Carrot-Ko-2B-Instruct 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 "CarrotAI/Carrot-Ko-2B-Instruct" \ --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": "CarrotAI/Carrot-Ko-2B-Instruct", "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 "CarrotAI/Carrot-Ko-2B-Instruct" \ --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": "CarrotAI/Carrot-Ko-2B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CarrotAI/Carrot-Ko-2B-Instruct with Docker Model Runner:
docker model run hf.co/CarrotAI/Carrot-Ko-2B-Instruct
Update README.md
Browse files
README.md
CHANGED
|
@@ -14,7 +14,7 @@ library_name: transformers
|
|
| 14 |
|
| 15 |
์์ฑํ ํ๊ตญ์ด ๋ฐ์ดํฐ์
์ผ๋ก axolotl์ ์ด์ฉํ์ฌ ํ์ธํ๋ํ์์ต๋๋ค.
|
| 16 |
|
| 17 |
-
[LogicKor](https://lk.instruct.kr/)์์ 2.1B์ ํ๋ผ๋ฉํฐ๋ก default ๊ธฐ์ค 4.
|
| 18 |
|
| 19 |
์์ง ์คํ์ค์ธ ๋ชจ๋ธ์
๋๋ค.
|
| 20 |
|
|
@@ -27,19 +27,19 @@ Qwen/Qwen2-1.5B-Instruct ๋ชจ๋ธ์ ์ด์ฉํ์ฌ ์์ฑํ์์ต๋๋ค.
|
|
| 27 |
default
|
| 28 |
|
| 29 |
| Category | Single turn | Multi turn |
|
| 30 |
-
|---|---|---|
|
| 31 |
-
|
|
| 32 |
-
|
|
| 33 |
-
|
|
| 34 |
-
|
|
| 35 |
-
|
|
| 36 |
-
|
|
| 37 |
|
| 38 |
| Category | Score |
|
| 39 |
-
|---|---|
|
| 40 |
-
| Single turn | 4.
|
| 41 |
-
| Multi turn | 3.
|
| 42 |
-
| Overall | 4.
|
| 43 |
|
| 44 |
|
| 45 |
|
|
|
|
| 14 |
|
| 15 |
์์ฑํ ํ๊ตญ์ด ๋ฐ์ดํฐ์
์ผ๋ก axolotl์ ์ด์ฉํ์ฌ ํ์ธํ๋ํ์์ต๋๋ค.
|
| 16 |
|
| 17 |
+
[LogicKor](https://lk.instruct.kr/)์์ 2.1B์ ํ๋ผ๋ฉํฐ๋ก default ๊ธฐ์ค 4.21์ ์ ๊ธฐ๋กํ์์ต๋๋ค.
|
| 18 |
|
| 19 |
์์ง ์คํ์ค์ธ ๋ชจ๋ธ์
๋๋ค.
|
| 20 |
|
|
|
|
| 27 |
default
|
| 28 |
|
| 29 |
| Category | Single turn | Multi turn |
|
| 30 |
+
|----------|-------------|------------|
|
| 31 |
+
| ์ดํด (Understanding) | 6.14 | 5.43 |
|
| 32 |
+
| ๋ฌธ๋ฒ (Grammar) | 5.00 | 2.43 |
|
| 33 |
+
| ์ํ (Math) | 1.86 | 1.86 |
|
| 34 |
+
| ์ถ๋ก (Reasoning) | 5.57 | 2.14 |
|
| 35 |
+
| ์ฝ๋ฉ (Coding) | 3.57 | 3.71 |
|
| 36 |
+
| ๊ธ์ฐ๊ธฐ (Writing) | 6.00 | 6.86 |
|
| 37 |
|
| 38 |
| Category | Score |
|
| 39 |
+
|----------|------|
|
| 40 |
+
| Single turn | 4.69 |
|
| 41 |
+
| Multi turn | 3.74 |
|
| 42 |
+
| Overall | 4.21 |
|
| 43 |
|
| 44 |
|
| 45 |
|