Skip to content

doc: fix the erroneous documents and example codes about Alibaba-NLP/gme-Qwen2-VL-2B-Instruct #6199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/backend/openai_api_embeddings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@
"source": [
"terminate_process(embedding_process)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Multi-Modal Embedding Model\n",
"Please refer to [Multi-Modal Embedding Model](../supported_models/embedding_models.md)"
]
}
],
"metadata": {
Expand Down
33 changes: 30 additions & 3 deletions docs/supported_models/embedding_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,42 @@ SGLang provides robust support for embedding models by integrating efficient ser
They are executed with `--is-embedding` and some may require `--trust-remote-code`
```

## Example launch Command
## Example Launch Command

```shell
python3 -m sglang.launch_server \
--model-path Alibaba-NLP/gme-Qwen2-VL-2B-Instruct \ # example HF/local path
--model-path Alibaba-NLP/gme-Qwen2-VL-2B-Instruct \
--is-embedding \
--host 0.0.0.0 \
--port 30000 \
--chat-template gme-qwen2-vl \
--port 30000
```
## Example Client Request
```python
import requests

url = "http://127.0.0.1:30000"

text_input = "Represent this image in embedding space."
image_path = "https://huggingface.co/datasets/liuhaotian/llava-bench-in-the-wild/resolve/main/images/023.jpg"

payload = {
"model": "gme-qwen2-vl",
"input": [
{
"text": text_input
},
{
"image": image_path
}
],
}

response = requests.post(url + "/v1/embeddings", json=payload).json()

print("Embeddings:", [x.get("embedding") for x in response.get("data", [])])
```


## Supporting Matrixs

Expand Down
5 changes: 1 addition & 4 deletions examples/runtime/multimodal_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

payload = {
"model": "gme-qwen2-vl",
"input": [
{"type": "text", "text": text_input},
{"type": "image", "url": image_path},
],
"input": [{"text": text_input}, {"image": image_path}],
}

response = requests.post(url + "/v1/embeddings", json=payload).json()
Expand Down
Loading