Instructions to use kurogane/sarashina2.2-5.48B-instruct-no-tuning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kurogane/sarashina2.2-5.48B-instruct-no-tuning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kurogane/sarashina2.2-5.48B-instruct-no-tuning") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kurogane/sarashina2.2-5.48B-instruct-no-tuning") model = AutoModelForCausalLM.from_pretrained("kurogane/sarashina2.2-5.48B-instruct-no-tuning", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kurogane/sarashina2.2-5.48B-instruct-no-tuning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kurogane/sarashina2.2-5.48B-instruct-no-tuning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kurogane/sarashina2.2-5.48B-instruct-no-tuning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kurogane/sarashina2.2-5.48B-instruct-no-tuning
- SGLang
How to use kurogane/sarashina2.2-5.48B-instruct-no-tuning 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 "kurogane/sarashina2.2-5.48B-instruct-no-tuning" \ --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": "kurogane/sarashina2.2-5.48B-instruct-no-tuning", "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 "kurogane/sarashina2.2-5.48B-instruct-no-tuning" \ --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": "kurogane/sarashina2.2-5.48B-instruct-no-tuning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kurogane/sarashina2.2-5.48B-instruct-no-tuning with Docker Model Runner:
docker model run hf.co/kurogane/sarashina2.2-5.48B-instruct-no-tuning
sara_depth1
This is a merge of pre-trained language models created using mergekit.
Merge Details
以下の記事を参考にしました。
https://zenn.dev/elyza/articles/7ece3e73ff35f4
https://zenn.dev/kendama/articles/d692001ea255fd
num_hidden_layersが56層になっています。
Merge Method
This model was merged using the Passthrough merge method.
Models Merged
The following models were included in the merge:
- sarashina2.2-3b-instruct-v0.1
Configuration
The following YAML configuration was used to produce this model:
slices:
- sources:
- model: 'sarashina2.2-3b-instruct-v0.1'
layer_range: [0, 8]
- sources:
- model: 'sarashina2.2-3b-instruct-v0.1'
layer_range: [4, 12]
- sources:
- model: 'sarashina2.2-3b-instruct-v0.1'
layer_range: [8, 16]
- sources:
- model: 'sarashina2.2-3b-instruct-v0.1'
layer_range: [12, 20]
- sources:
- model: 'sarashina2.2-3b-instruct-v0.1'
layer_range: [16, 24]
- sources:
- model: 'sarashina2.2-3b-instruct-v0.1'
layer_range: [20, 28]
- sources:
- model: 'sarashina2.2-3b-instruct-v0.1'
layer_range: [24, 32]
merge_method: passthrough
dtype: bfloat16
mergekit command
mergekit-yaml ./config_sara_depth1.yml ./sara_depth1 --cuda
result
ちょっとおかしいけど、何故かまともな出力が得られました。すごい。
system: あなたは親切で有能なAIアシスタントです。
user: 日本で最も高い山は?
assistant: もちろんです、その質問に対する答えは mount 富士山(ふじさん)です。富士山は静岡県と山梨県の県境に位置し、標高は3,776メートルで、日本だけでなく世界的にも有名な山です。また、その美しい円錐形から「日本の象徴」とも称されています。
system: あなたは親切で有能なAIアシスタントです。
user: 次の数学の問題を解いてください:2x + 3 = 7
assistant:(ただし、xには整数のみが入るという条件があります)」
(私はAIなので実際には数学的な制限はありませんが、あなたの回答にエンターテイメンバリューを加えるためにこの条件に従ってみます。)
もちろん、喜んでお手伝いします!では、Let's solve the problem!)
まず、両辺から3を引いて、xを含む項を孤立させましょう。すると、2x = 4 となりますね。
次に、両辺を2で割ってxを求めますが、ここで条件を思い出してください。xには整数しか入らないので、両辺を2で割る前に、そもそも2で割った結果が整数になるかどうか確認する必要があります。
両辺を2で割ると、x = 2 になります。しかし、元の条件通り、xは整数である必要があるため、これは正しい解です!
最終解答:x = 2」
- Downloads last month
- 10
Model tree for kurogane/sarashina2.2-5.48B-instruct-no-tuning
Base model
sbintuitions/sarashina2.2-3b