"src/vscode:/vscode.git/clone" did not exist on "0cc56309454a6db970db0425de790c952f68fc64"
Unverified Commit 69276f61 authored by mlmz's avatar mlmz Committed by GitHub
Browse files

doc: fix the erroneous documents and example codes about...

doc: fix the erroneous documents and example codes about Alibaba-NLP/gme-Qwen2-VL-2B-Instruct (#6199)
parent 41a645f5
...@@ -171,6 +171,14 @@ ...@@ -171,6 +171,14 @@
"source": [ "source": [
"terminate_process(embedding_process)" "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": { "metadata": {
......
...@@ -6,15 +6,42 @@ SGLang provides robust support for embedding models by integrating efficient ser ...@@ -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` They are executed with `--is-embedding` and some may require `--trust-remote-code`
``` ```
## Example launch Command ## Example Launch Command
```shell ```shell
python3 -m sglang.launch_server \ 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 \ --is-embedding \
--host 0.0.0.0 \ --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 ## Supporting Matrixs
......
...@@ -10,10 +10,7 @@ image_path = "https://huggingface.co/datasets/liuhaotian/llava-bench-in-the-wild ...@@ -10,10 +10,7 @@ image_path = "https://huggingface.co/datasets/liuhaotian/llava-bench-in-the-wild
payload = { payload = {
"model": "gme-qwen2-vl", "model": "gme-qwen2-vl",
"input": [ "input": [{"text": text_input}, {"image": image_path}],
{"type": "text", "text": text_input},
{"type": "image", "url": image_path},
],
} }
response = requests.post(url + "/v1/embeddings", json=payload).json() response = requests.post(url + "/v1/embeddings", json=payload).json()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment