"src/vscode:/vscode.git/clone" did not exist on "cdadb023a298674239561d0395db2056b4f1d7d7"
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 @@
"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": {
......
......@@ -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
......
......@@ -10,10 +10,7 @@ image_path = "https://huggingface.co/datasets/liuhaotian/llava-bench-in-the-wild
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()
......
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