Instructions to use niryuu/Karasu-1.1b-chat-vector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use niryuu/Karasu-1.1b-chat-vector with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="niryuu/Karasu-1.1b-chat-vector") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("niryuu/Karasu-1.1b-chat-vector") model = AutoModelForCausalLM.from_pretrained("niryuu/Karasu-1.1b-chat-vector") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use niryuu/Karasu-1.1b-chat-vector with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "niryuu/Karasu-1.1b-chat-vector" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "niryuu/Karasu-1.1b-chat-vector", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/niryuu/Karasu-1.1b-chat-vector
- SGLang
How to use niryuu/Karasu-1.1b-chat-vector 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 "niryuu/Karasu-1.1b-chat-vector" \ --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": "niryuu/Karasu-1.1b-chat-vector", "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 "niryuu/Karasu-1.1b-chat-vector" \ --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": "niryuu/Karasu-1.1b-chat-vector", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use niryuu/Karasu-1.1b-chat-vector with Docker Model Runner:
docker model run hf.co/niryuu/Karasu-1.1b-chat-vector
Upload LlamaForCausalLM
Browse files- config.json +4 -3
- generation_config.json +4 -1
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
@@ -16,6 +16,7 @@
|
|
| 16 |
"num_attention_heads": 32,
|
| 17 |
"num_hidden_layers": 22,
|
| 18 |
"num_key_value_heads": 4,
|
|
|
|
| 19 |
"pretraining_tp": 1,
|
| 20 |
"rms_norm_eps": 1e-05,
|
| 21 |
"rope_scaling": null,
|
|
@@ -23,6 +24,6 @@
|
|
| 23 |
"tie_word_embeddings": false,
|
| 24 |
"torch_dtype": "bfloat16",
|
| 25 |
"transformers_version": "4.39.0",
|
| 26 |
-
"use_cache":
|
| 27 |
-
"vocab_size":
|
| 28 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "lightblue/karasu-1.1B",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
|
|
| 16 |
"num_attention_heads": 32,
|
| 17 |
"num_hidden_layers": 22,
|
| 18 |
"num_key_value_heads": 4,
|
| 19 |
+
"pad_token_id": 0,
|
| 20 |
"pretraining_tp": 1,
|
| 21 |
"rms_norm_eps": 1e-05,
|
| 22 |
"rope_scaling": null,
|
|
|
|
| 24 |
"tie_word_embeddings": false,
|
| 25 |
"torch_dtype": "bfloat16",
|
| 26 |
"transformers_version": "4.39.0",
|
| 27 |
+
"use_cache": true,
|
| 28 |
+
"vocab_size": 32000
|
| 29 |
}
|
generation_config.json
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
|
|
|
|
|
|
|
|
|
| 3 |
"transformers_version": "4.39.0"
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token_id": 1,
|
| 3 |
+
"eos_token_id": 2,
|
| 4 |
+
"max_length": 2048,
|
| 5 |
+
"pad_token_id": 0,
|
| 6 |
"transformers_version": "4.39.0"
|
| 7 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da47d6e9f7545bb4de9e7390d62934c6e0885b07e5ad53b637062dbf6ca12c6d
|
| 3 |
+
size 2200119864
|