lint: format all python file instead of just source code (#2567)
This commit is contained in:
parent
9b945daaf1
commit
1e4277d2d1
2
.github/workflows/yapf.yml
vendored
2
.github/workflows/yapf.yml
vendored
@ -28,4 +28,4 @@ jobs:
|
|||||||
pip install toml==0.10.2
|
pip install toml==0.10.2
|
||||||
- name: Running yapf
|
- name: Running yapf
|
||||||
run: |
|
run: |
|
||||||
yapf --diff --recursive vllm tests
|
yapf --diff --recursive .
|
||||||
|
@ -92,17 +92,9 @@ async def get_request(
|
|||||||
await asyncio.sleep(interval)
|
await asyncio.sleep(interval)
|
||||||
|
|
||||||
|
|
||||||
async def send_request(
|
async def send_request(backend: str, model: str, api_url: str, prompt: str,
|
||||||
backend: str,
|
prompt_len: int, output_len: int, best_of: int,
|
||||||
model: str,
|
use_beam_search: bool, pbar: tqdm) -> None:
|
||||||
api_url: str,
|
|
||||||
prompt: str,
|
|
||||||
prompt_len: int,
|
|
||||||
output_len: int,
|
|
||||||
best_of: int,
|
|
||||||
use_beam_search: bool,
|
|
||||||
pbar: tqdm
|
|
||||||
) -> None:
|
|
||||||
request_start_time = time.perf_counter()
|
request_start_time = time.perf_counter()
|
||||||
|
|
||||||
headers = {"User-Agent": "Benchmark Client"}
|
headers = {"User-Agent": "Benchmark Client"}
|
||||||
@ -155,7 +147,6 @@ async def send_request(
|
|||||||
pbar.update(1)
|
pbar.update(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async def benchmark(
|
async def benchmark(
|
||||||
backend: str,
|
backend: str,
|
||||||
model: str,
|
model: str,
|
||||||
@ -217,7 +208,10 @@ if __name__ == "__main__":
|
|||||||
type=str,
|
type=str,
|
||||||
default="vllm",
|
default="vllm",
|
||||||
choices=["vllm", "tgi"])
|
choices=["vllm", "tgi"])
|
||||||
parser.add_argument("--protocol", type=str, default="http", choices=["http", "https"])
|
parser.add_argument("--protocol",
|
||||||
|
type=str,
|
||||||
|
default="http",
|
||||||
|
choices=["http", "https"])
|
||||||
parser.add_argument("--host", type=str, default="localhost")
|
parser.add_argument("--host", type=str, default="localhost")
|
||||||
parser.add_argument("--port", type=int, default=8000)
|
parser.add_argument("--port", type=int, default=8000)
|
||||||
parser.add_argument("--endpoint", type=str, default="/generate")
|
parser.add_argument("--endpoint", type=str, default="/generate")
|
||||||
|
@ -32,6 +32,5 @@ chat_completion = client.chat.completions.create(
|
|||||||
model=model,
|
model=model,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
print("Chat completion results:")
|
print("Chat completion results:")
|
||||||
print(chat_completion)
|
print(chat_completion)
|
||||||
|
@ -21,8 +21,7 @@ completion = client.completions.create(
|
|||||||
echo=False,
|
echo=False,
|
||||||
n=2,
|
n=2,
|
||||||
stream=stream,
|
stream=stream,
|
||||||
logprobs=3
|
logprobs=3)
|
||||||
)
|
|
||||||
|
|
||||||
print("Completion results:")
|
print("Completion results:")
|
||||||
if stream:
|
if stream:
|
||||||
|
@ -71,7 +71,7 @@ format_changed() {
|
|||||||
|
|
||||||
# Format all files
|
# Format all files
|
||||||
format_all() {
|
format_all() {
|
||||||
yapf --in-place "${YAPF_FLAGS[@]}" "${YAPF_EXCLUDES[@]}" vllm tests
|
yapf --in-place "${YAPF_FLAGS[@]}" "${YAPF_EXCLUDES[@]}" .
|
||||||
}
|
}
|
||||||
|
|
||||||
## This flag formats individual files. --files *must* be the first command line
|
## This flag formats individual files. --files *must* be the first command line
|
||||||
|
Loading…
x
Reference in New Issue
Block a user