Migrate linter from pylint to ruff (#1665)

This commit is contained in:
Simon Mo
2023-11-20 11:58:01 -08:00
committed by GitHub
parent 112627e8b2
commit 5ffc0d13a2
45 changed files with 122 additions and 607 deletions

View File

@@ -24,7 +24,6 @@ def _query_server(prompt: str) -> dict:
def api_server():
script_path = Path(__file__).parent.joinpath(
"api_server_async_engine.py").absolute()
# pylint: disable=consider-using-with
uvicorn_process = subprocess.Popen([
sys.executable, "-u",
str(script_path), "--model", "facebook/opt-125m"
@@ -33,7 +32,6 @@ def api_server():
uvicorn_process.terminate()
# pylint: disable=redefined-outer-name, unused-argument
def test_api_server(api_server):
"""
Run the API server and test it.
@@ -49,11 +47,10 @@ def test_api_server(api_server):
prompts = ["Hello world"] * 1
result = None
while not result:
# pylint: disable=bare-except
try:
for result in pool.map(_query_server, prompts):
for _ in pool.map(_query_server, prompts):
break
except:
except Exception:
time.sleep(1)
# Actual tests start here