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": [
|
"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
|
|||||||
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
|
|||||||
|
|
||||||
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()
|
||||||
|
|||||||
Reference in New Issue
Block a user