Instructions to use ggml-org/embeddinggemma-300M-qat-q4_0-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ggml-org/embeddinggemma-300M-qat-q4_0-GGUF with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ggml-org/embeddinggemma-300M-qat-q4_0-GGUF") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ggml-org/embeddinggemma-300M-qat-q4_0-GGUF 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 ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0 # Run inference directly in the terminal: llama cli -hf ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0 # Run inference directly in the terminal: llama cli -hf ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0
Use pre-built binary
# 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 ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0 # Run inference directly in the terminal: ./llama-cli -hf ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0
Build from source code
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 ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0
Use Docker
docker model run hf.co/ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0
- LM Studio
- Jan
- Ollama
How to use ggml-org/embeddinggemma-300M-qat-q4_0-GGUF with Ollama:
ollama run hf.co/ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0
- Unsloth Desktop
- Docker Model Runner
How to use ggml-org/embeddinggemma-300M-qat-q4_0-GGUF with Docker Model Runner:
docker model run hf.co/ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0
- Lemonade
How to use ggml-org/embeddinggemma-300M-qat-q4_0-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ggml-org/embeddinggemma-300M-qat-q4_0-GGUF:Q4_0
Run and chat with the model
lemonade run user.embeddinggemma-300M-qat-q4_0-GGUF-Q4_0
List all available models
lemonade list
- Atomic Chat
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model:
|
| 3 |
+
- google/embeddinggemma-300M-qat-q4_0
|
| 4 |
+
---
|
| 5 |
+
# embeddinggemma-300M-qat-q4_0 GGUF
|
| 6 |
+
|
| 7 |
+
Recommended way to run this model:
|
| 8 |
+
|
| 9 |
+
```sh
|
| 10 |
+
llama-server -hf ggml-org/embeddinggemma-300M-qat-q4_0-GGUF
|
| 11 |
+
```
|
| 12 |
+
|
| 13 |
+
Then the endpoint can be accessed at http://localhost:8080/embedding, for
|
| 14 |
+
example using `curl`:
|
| 15 |
+
```console
|
| 16 |
+
curl --request POST \
|
| 17 |
+
--url http://localhost:8080/embedding \
|
| 18 |
+
--header "Content-Type: application/json" \
|
| 19 |
+
--data '{"input": "Hello embeddings"}' \
|
| 20 |
+
--silent
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
Alternatively, the `llama-embedding` command line tool can be used:
|
| 24 |
+
```sh
|
| 25 |
+
llama-embedding -hf ggml-org/embeddinggemma-300M-qat-q4_0-GGUF --verbose-prompt -p "Hello embeddings"
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
#### embd_normalize
|
| 29 |
+
When a model uses pooling, or the pooling method is specified using `--pooling`,
|
| 30 |
+
the normalization can be controlled by the `embd_normalize` parameter.
|
| 31 |
+
|
| 32 |
+
The default value is `2` which means that the embeddings are normalized using
|
| 33 |
+
the Euclidean norm (L2). Other options are:
|
| 34 |
+
* -1 No normalization
|
| 35 |
+
* 0 Max absolute
|
| 36 |
+
* 1 Taxicab
|
| 37 |
+
* 2 Euclidean/L2
|
| 38 |
+
* \>2 P-Norm
|
| 39 |
+
|
| 40 |
+
This can be passed in the request body to `llama-server`, for example:
|
| 41 |
+
```sh
|
| 42 |
+
--data '{"input": "Hello embeddings", "embd_normalize": -1}' \
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
And for `llama-embedding`, by passing `--embd-normalize <value>`, for example:
|
| 46 |
+
```sh
|
| 47 |
+
llama-embedding -hf ggml-org/embeddinggemma-300M-qat-q4_0-GGUF --embd-normalize -1 -p "Hello embeddings"
|
| 48 |
+
```
|