Instructions to use robbiemu/salamandra-2b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use robbiemu/salamandra-2b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="robbiemu/salamandra-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("robbiemu/salamandra-2b-instruct") model = AutoModelForCausalLM.from_pretrained("robbiemu/salamandra-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
- llama.cpp
How to use robbiemu/salamandra-2b-instruct with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf robbiemu/salamandra-2b-instruct:Q4_K_M # Run inference directly in the terminal: llama cli -hf robbiemu/salamandra-2b-instruct:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf robbiemu/salamandra-2b-instruct:Q4_K_M # Run inference directly in the terminal: llama cli -hf robbiemu/salamandra-2b-instruct:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf robbiemu/salamandra-2b-instruct:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf robbiemu/salamandra-2b-instruct:Q4_K_M
Use Docker
docker model run hf.co/robbiemu/salamandra-2b-instruct:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use robbiemu/salamandra-2b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "robbiemu/salamandra-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": "robbiemu/salamandra-2b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/robbiemu/salamandra-2b-instruct:Q4_K_M
- SGLang
How to use robbiemu/salamandra-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 "robbiemu/salamandra-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": "robbiemu/salamandra-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 "robbiemu/salamandra-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": "robbiemu/salamandra-2b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use robbiemu/salamandra-2b-instruct with Ollama:
ollama run hf.co/robbiemu/salamandra-2b-instruct:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use robbiemu/salamandra-2b-instruct with Docker Model Runner:
docker model run hf.co/robbiemu/salamandra-2b-instruct:Q4_K_M
- Lemonade
How to use robbiemu/salamandra-2b-instruct with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull robbiemu/salamandra-2b-instruct:Q4_K_M
Run and chat with the model
lemonade run user.salamandra-2b-instruct-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Commit ·
bdc4a9f
1
Parent(s): bae5ed5
Update README.md
Browse files
README.md
CHANGED
|
@@ -51,7 +51,7 @@ This model card corresponds to the 2B instructed version.
|
|
| 51 |
To visit the model cards of other Salamandra versions, please refer to the [Model Index](#model-index).
|
| 52 |
|
| 53 |
The entire Salamandra family is released under a permissive [Apache 2.0 license]((https://www.apache.org/licenses/LICENSE-2.0)).
|
| 54 |
-
Along with the open weights, all training scripts and configuration files are made publicly available in [this GitHub repository](https://github.com/
|
| 55 |
|
| 56 |
> [!WARNING]
|
| 57 |
> **DISCLAIMER:** This model is a first proof-of-concept designed to demonstrate the instruction-following capabilities of recently released base models.
|
|
@@ -70,7 +70,7 @@ The pre-training corpus contains text in 35 European languages and code.
|
|
| 70 |
|
| 71 |
### Hyperparameters
|
| 72 |
|
| 73 |
-
The full list of hyperparameters for each model can be found [here](https://github.com/
|
| 74 |
|
| 75 |
### Architecture
|
| 76 |
|
|
@@ -156,7 +156,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
| 156 |
import transformers
|
| 157 |
import torch
|
| 158 |
|
| 159 |
-
model_id = "
|
| 160 |
|
| 161 |
text = "At what temperature does water boil?"
|
| 162 |
|
|
@@ -678,6 +678,6 @@ Technical report and paper coming soon.
|
|
| 678 |
## Model Index
|
| 679 |
|Model|Base|Instruct|
|
| 680 |
|:---:|:---:|:---:|
|
| 681 |
-
|2B| [Link](https://huggingface.co/
|
| 682 |
-
|7B| [Link](https://huggingface.co/
|
| 683 |
|40B| WiP | WiP |
|
|
|
|
| 51 |
To visit the model cards of other Salamandra versions, please refer to the [Model Index](#model-index).
|
| 52 |
|
| 53 |
The entire Salamandra family is released under a permissive [Apache 2.0 license]((https://www.apache.org/licenses/LICENSE-2.0)).
|
| 54 |
+
Along with the open weights, all training scripts and configuration files are made publicly available in [this GitHub repository](https://github.com/langtech-bsc/salamandra).
|
| 55 |
|
| 56 |
> [!WARNING]
|
| 57 |
> **DISCLAIMER:** This model is a first proof-of-concept designed to demonstrate the instruction-following capabilities of recently released base models.
|
|
|
|
| 70 |
|
| 71 |
### Hyperparameters
|
| 72 |
|
| 73 |
+
The full list of hyperparameters for each model can be found [here](https://github.com/langtech-bsc/salamandra/tree/main/configs).
|
| 74 |
|
| 75 |
### Architecture
|
| 76 |
|
|
|
|
| 156 |
import transformers
|
| 157 |
import torch
|
| 158 |
|
| 159 |
+
model_id = "BSC-LT/salamandra-2b-instruct"
|
| 160 |
|
| 161 |
text = "At what temperature does water boil?"
|
| 162 |
|
|
|
|
| 678 |
## Model Index
|
| 679 |
|Model|Base|Instruct|
|
| 680 |
|:---:|:---:|:---:|
|
| 681 |
+
|2B| [Link](https://huggingface.co/BSC-LT/salamandra-2b) | [Link](https://huggingface.co/BSC-LT/salamandra-2b-instruct) |
|
| 682 |
+
|7B| [Link](https://huggingface.co/BSC-LT/salamandra-7b) | [Link](https://huggingface.co/BSC-LT/salamandra-7b-instruct) |
|
| 683 |
|40B| WiP | WiP |
|