[Lint]Style: Convert root, benchmarks, tools and docs to ruff format (#5843)
### What this PR does / why we need it?
Description
This PR fixes linting issues in the root directory, benchmarks/, tools/
and docs/ to align with the project's Ruff configuration.
This is part of a gradual effort to enable full linting coverage across
the repository. The corresponding paths have been removed from the
exclude list in pyproject.toml.
### Does this PR introduce _any_ user-facing change?
### How was this patch tested?
- vLLM version: v0.13.0
- vLLM main:
2f4e6548ef
---------
Signed-off-by: root <root@LAPTOP-VQKDDVMG.localdomain>
Co-authored-by: root <root@LAPTOP-VQKDDVMG.localdomain>
This commit is contained in:
@@ -4,39 +4,30 @@ import os
|
||||
import requests
|
||||
from modelscope import snapshot_download # type: ignore
|
||||
|
||||
mm_dir = snapshot_download("vllm-ascend/mm_request", repo_type='dataset')
|
||||
mm_dir = snapshot_download("vllm-ascend/mm_request", repo_type="dataset")
|
||||
image_path = os.path.join(mm_dir, "test_mm2.jpg")
|
||||
with open(image_path, 'rb') as image_file:
|
||||
image_data = base64.b64encode(image_file.read()).decode('utf-8')
|
||||
with open(image_path, "rb") as image_file:
|
||||
image_data = base64.b64encode(image_file.read()).decode("utf-8")
|
||||
|
||||
data = {
|
||||
"messages": [{
|
||||
"role":
|
||||
"user",
|
||||
"content": [{
|
||||
"type": "text",
|
||||
"text": "What is the content of this image?"
|
||||
}, {
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": f"data:image/jpeg;base64,{image_data}"
|
||||
}
|
||||
}]
|
||||
}],
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{"type": "text", "text": "What is the content of this image?"},
|
||||
{"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{image_data}"}},
|
||||
],
|
||||
}
|
||||
],
|
||||
"eos_token_id": [1, 106],
|
||||
"pad_token_id":
|
||||
0,
|
||||
"top_k":
|
||||
64,
|
||||
"top_p":
|
||||
0.95,
|
||||
"max_tokens":
|
||||
8192,
|
||||
"stream":
|
||||
False
|
||||
"pad_token_id": 0,
|
||||
"top_k": 64,
|
||||
"top_p": 0.95,
|
||||
"max_tokens": 8192,
|
||||
"stream": False,
|
||||
}
|
||||
|
||||
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
|
||||
headers = {"Accept": "application/json", "Content-Type": "application/json"}
|
||||
|
||||
|
||||
def send_image_request(model, server):
|
||||
|
||||
Reference in New Issue
Block a user