doc: fix the erroneous documents and example codes about Alibaba-NLP/gme-Qwen2-VL-2B-Instruct (#6199)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user