HuggingFaceFW/fineweb-edu
Viewer • Updated • 3.5B • 430k • 1.31k
How to use jrosell/salamandra-2b-GGUF with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="jrosell/salamandra-2b-GGUF") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("jrosell/salamandra-2b-GGUF", device_map="auto")How to use jrosell/salamandra-2b-GGUF with llama.cpp:
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf jrosell/salamandra-2b-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf jrosell/salamandra-2b-GGUF:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf jrosell/salamandra-2b-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf jrosell/salamandra-2b-GGUF:Q4_K_M
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf jrosell/salamandra-2b-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf jrosell/salamandra-2b-GGUF:Q4_K_M
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf jrosell/salamandra-2b-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf jrosell/salamandra-2b-GGUF:Q4_K_M
docker model run hf.co/jrosell/salamandra-2b-GGUF:Q4_K_M
How to use jrosell/salamandra-2b-GGUF with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "jrosell/salamandra-2b-GGUF"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "jrosell/salamandra-2b-GGUF",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/jrosell/salamandra-2b-GGUF:Q4_K_M
How to use jrosell/salamandra-2b-GGUF with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "jrosell/salamandra-2b-GGUF" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "jrosell/salamandra-2b-GGUF",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "jrosell/salamandra-2b-GGUF" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "jrosell/salamandra-2b-GGUF",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use jrosell/salamandra-2b-GGUF with Ollama:
ollama run hf.co/jrosell/salamandra-2b-GGUF:Q4_K_M
How to use jrosell/salamandra-2b-GGUF with Docker Model Runner:
docker model run hf.co/jrosell/salamandra-2b-GGUF:Q4_K_M
How to use jrosell/salamandra-2b-GGUF with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull jrosell/salamandra-2b-GGUF:Q4_K_M
lemonade run user.salamandra-2b-GGUF-Q4_K_M
lemonade list
In this repo you can find the quantized versions of "BSC-LT/salamandra-2b" ready to use in ollama and R.
To use it, first download this repo:
$ hf download "jrosell/salamandra-2b-GGUF"
$ cd "$HOME/.cache/huggingface/hub/models--BSC-LT--salamandra-2b/snapshots/$(cat ~/.cache/huggingface/hub/models--BSC-LT--salamandra-2b/refs/main)"
Use GGUF Q8_0 version in Ollama
$ echo "FROM ./models/salamandra-2b-Q8_0.gguf" > Modelfile.Q8_0
$ ollama create salamandra-2b:Q8_0 -f Modelfile.Q8_0
$ ollama run salamandra-2b:Q8_0
Use the Quantized Q4_K_M version in Ollama:
$ echo "FROM ./models/salamandra-2b-Q4_K_M.gguf" > Modelfile.Q4_K_M
$ ollama create salamandra-2b:Q4_K_M -f Modelfile.Q4_K_M
$ ollama run salamandra-2b:Q4_K_M
Use it in R:
$ R --vanilla -e 'ellmer::chat_ollama(model = "salamandra-2b:Q4_K_M")$chat("Explica un acudit sobre informàtics.")'
$ mkdir -p salamandra-2b/models && cd salamandra-2b
$ hf download "BSC-LT/salamandra-2b"
$ git clone https://github.com/ggerganov/llama.cpp.git
$ uv init
$ uv add -r llama.cpp/requirements.txt
$ export MODEL_DIR="$HOME/.cache/huggingface/hub/models--BSC-LT--salamandra-2b/snapshots/$(cat ~/.cache/huggingface/hub/models--BSC-LT--salamandra-2b/refs/main)"
$ uv run llama.cpp/convert_hf_to_gguf.py $MODEL_DIR \
--outfile models/salamandra-2b.gguf \
--outtype auto
$ cd llama.cpp
$ cmake -B build
$ cmake --build build --config Release --target llama-quantize
$ ./build/bin/llama-quantize ../models/salamandra-2b.gguf ../models/salamandra-2b-Q4_K_M.gguf Q4_K_M
Base model
BSC-LT/salamandra-2b