

chore: adjust model manager test sleep delay
@2e7d12b0de68a4612f0fe821bca43eac543135c0
--- src/faster_whisper_server/api_models.py
+++ src/faster_whisper_server/api_models.py
... | ... | @@ -69,7 +69,7 @@ |
69 | 69 |
end=segment.end, |
70 | 70 |
text=segment.text, |
71 | 71 |
tokens=segment.tokens, |
72 |
- temperature=segment.temperature, |
|
72 |
+ temperature=segment.temperature or 0, # FIX: hardcoded |
|
73 | 73 |
avg_logprob=segment.avg_logprob, |
74 | 74 |
compression_ratio=segment.compression_ratio, |
75 | 75 |
no_speech_prob=segment.no_speech_prob, |
--- tests/model_manager_test.py
+++ tests/model_manager_test.py
... | ... | @@ -20,7 +20,7 @@ |
20 | 20 |
await aclient.post(f"/api/ps/{model}") |
21 | 21 |
res = (await aclient.get("/api/ps")).json() |
22 | 22 |
assert len(res["models"]) == 1 |
23 |
- await asyncio.sleep(ttl + 1) |
|
23 |
+ await asyncio.sleep(ttl + 1) # wait for the model to be unloaded |
|
24 | 24 |
res = (await aclient.get("/api/ps")).json() |
25 | 25 |
assert len(res["models"]) == 0 |
26 | 26 |
|
... | ... | @@ -35,7 +35,7 @@ |
35 | 35 |
await aclient.post(f"/api/ps/{model}") |
36 | 36 |
res = (await aclient.get("/api/ps")).json() |
37 | 37 |
assert len(res["models"]) == 1 |
38 |
- await asyncio.sleep(ttl - 2) |
|
38 |
+ await asyncio.sleep(ttl - 2) # sleep for less than the ttl. The model should not be unloaded |
|
39 | 39 |
res = (await aclient.get("/api/ps")).json() |
40 | 40 |
assert len(res["models"]) == 1 |
41 | 41 |
|
... | ... | @@ -48,11 +48,11 @@ |
48 | 48 |
).json() |
49 | 49 |
res = (await aclient.get("/api/ps")).json() |
50 | 50 |
assert len(res["models"]) == 1 |
51 |
- await asyncio.sleep(ttl - 2) |
|
51 |
+ await asyncio.sleep(ttl - 2) # sleep for less than the ttl. The model should not be unloaded |
|
52 | 52 |
res = (await aclient.get("/api/ps")).json() |
53 | 53 |
assert len(res["models"]) == 1 |
54 | 54 |
|
55 |
- await asyncio.sleep(3) |
|
55 |
+ await asyncio.sleep(3) # sleep for a bit more. The model should be unloaded |
|
56 | 56 |
res = (await aclient.get("/api/ps")).json() |
57 | 57 |
assert len(res["models"]) == 0 |
58 | 58 |
|
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 |
"/v1/audio/transcriptions", files={"file": ("audio.wav", data, "audio/wav")}, data={"model": model} |
81 | 81 |
) |
82 | 82 |
) |
83 |
- await asyncio.sleep(0.01) |
|
83 |
+ await asyncio.sleep(0.1) # wait for the server to start processing the request |
|
84 | 84 |
res = await aclient.delete(f"/api/ps/{model}") |
85 | 85 |
assert res.status_code == 409 |
86 | 86 |
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?