Skip to content

Commit 7c979ac

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2790dd3 commit 7c979ac

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

tests/e2e/default_single_streaming.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from litserve import LitServer, LitAPI
2-
import time
3-
import numpy as np
2+
43

54
class SimpleStreamingAPI(LitAPI):
65
def setup(self, device) -> None:
7-
self.model = lambda x,y: x*y
6+
self.model = lambda x, y: x * y
87

98
def decode_request(self, request):
109
return request["input"]
@@ -21,4 +20,4 @@ def encode_response(self, output_stream):
2120
if __name__ == "__main__":
2221
api = SimpleStreamingAPI()
2322
server = LitServer(api, stream=True)
24-
server.run(port=8000)
23+
server.run(port=8000)

tests/e2e/test_e2e.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ def test_openai_parity_with_response_format():
297297
)
298298

299299

300-
301300
@e2e_from_file("tests/e2e/default_single_streaming.py")
302301
def test_e2e_single_streaming():
303302
resp = requests.post("http://127.0.0.1:8000/predict", json={"input": 4.0}, headers=None, stream=True)
@@ -306,7 +305,7 @@ def test_e2e_single_streaming():
306305
outputs = []
307306
for line in resp.iter_lines():
308307
if line:
309-
outputs.append(json.loads(line.decode('utf-8')))
308+
outputs.append(json.loads(line.decode("utf-8")))
310309

311310
assert len(outputs) > 1, "Expected multiple streamed outputs"
312311
assert len(outputs) == 3, "Expected 3 streamed outputs"
@@ -316,4 +315,4 @@ def test_e2e_single_streaming():
316315
for i, output in enumerate(outputs[:-1]):
317316
assert 0 < output["output"] <= 12.0, f"Intermediate output {i} is not within expected range"
318317
if i > 0:
319-
assert output["output"] >= outputs[i-1]["output"], "Outputs are not monotonically increasing"
318+
assert output["output"] >= outputs[i - 1]["output"], "Outputs are not monotonically increasing"

0 commit comments

Comments
 (0)