Text Generation
Transformers
Safetensors
Japanese
English
mistral
conversational
text-generation-inference
Instructions to use lightblue/karasu-7B-chat-plus with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lightblue/karasu-7B-chat-plus with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lightblue/karasu-7B-chat-plus") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lightblue/karasu-7B-chat-plus") model = AutoModelForCausalLM.from_pretrained("lightblue/karasu-7B-chat-plus") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use lightblue/karasu-7B-chat-plus with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lightblue/karasu-7B-chat-plus" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lightblue/karasu-7B-chat-plus", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lightblue/karasu-7B-chat-plus
- SGLang
How to use lightblue/karasu-7B-chat-plus 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 "lightblue/karasu-7B-chat-plus" \ --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": "lightblue/karasu-7B-chat-plus", "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 "lightblue/karasu-7B-chat-plus" \ --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": "lightblue/karasu-7B-chat-plus", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lightblue/karasu-7B-chat-plus with Docker Model Runner:
docker model run hf.co/lightblue/karasu-7B-chat-plus
File size: 1,368 Bytes
a3f8afe | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | {
"<|extra_0|>": 32000,
"<|extra_10|>": 32010,
"<|extra_11|>": 32011,
"<|extra_12|>": 32012,
"<|extra_13|>": 32013,
"<|extra_14|>": 32014,
"<|extra_15|>": 32015,
"<|extra_16|>": 32016,
"<|extra_17|>": 32017,
"<|extra_18|>": 32018,
"<|extra_19|>": 32019,
"<|extra_1|>": 32001,
"<|extra_20|>": 32020,
"<|extra_21|>": 32021,
"<|extra_22|>": 32022,
"<|extra_23|>": 32023,
"<|extra_24|>": 32024,
"<|extra_25|>": 32025,
"<|extra_26|>": 32026,
"<|extra_27|>": 32027,
"<|extra_28|>": 32028,
"<|extra_29|>": 32029,
"<|extra_2|>": 32002,
"<|extra_30|>": 32030,
"<|extra_31|>": 32031,
"<|extra_32|>": 32032,
"<|extra_33|>": 32033,
"<|extra_34|>": 32034,
"<|extra_35|>": 32035,
"<|extra_36|>": 32036,
"<|extra_37|>": 32037,
"<|extra_38|>": 32038,
"<|extra_39|>": 32039,
"<|extra_3|>": 32003,
"<|extra_40|>": 32040,
"<|extra_41|>": 32041,
"<|extra_42|>": 32042,
"<|extra_43|>": 32043,
"<|extra_44|>": 32044,
"<|extra_45|>": 32045,
"<|extra_46|>": 32046,
"<|extra_47|>": 32047,
"<|extra_48|>": 32048,
"<|extra_49|>": 32049,
"<|extra_4|>": 32004,
"<|extra_50|>": 32050,
"<|extra_51|>": 32051,
"<|extra_52|>": 32052,
"<|extra_53|>": 32053,
"<|extra_54|>": 32054,
"<|extra_5|>": 32005,
"<|extra_6|>": 32006,
"<|extra_7|>": 32007,
"<|extra_8|>": 32008,
"<|extra_9|>": 32009
}
|