feat: update tests

This commit is contained in:
drbh 2024-02-22 20:05:58 +00:00
parent d2635dd01b
commit 6690daec09
8 changed files with 140 additions and 112 deletions

View File

@ -11,47 +11,47 @@
}, },
{ {
"id": 49833, "id": 49833,
"logprob": -10.5390625, "logprob": -10.5859375,
"text": " dég" "text": " dég"
}, },
{ {
"id": 21543, "id": 21543,
"logprob": -0.14758301, "logprob": -0.14794922,
"text": "uster" "text": "uster"
}, },
{ {
"id": 447, "id": 447,
"logprob": -1.9296875, "logprob": -1.9277344,
"text": " un" "text": " un"
}, },
{ {
"id": 46341, "id": 46341,
"logprob": -15.4453125, "logprob": -15.3203125,
"text": " ort" "text": " ort"
}, },
{ {
"id": 35567, "id": 35567,
"logprob": -7.59375, "logprob": -7.5664062,
"text": "olan" "text": "olan"
}, },
{ {
"id": 15, "id": 15,
"logprob": -1.3994141, "logprob": -1.3974609,
"text": "," "text": ","
}, },
{ {
"id": 1669, "id": 1669,
"logprob": -1.578125, "logprob": -1.5351562,
"text": " il" "text": " il"
}, },
{ {
"id": 11580, "id": 11580,
"logprob": -0.9453125, "logprob": -0.9423828,
"text": " faut" "text": " faut"
}, },
{ {
"id": 3913, "id": 3913,
"logprob": -3.7011719, "logprob": -3.671875,
"text": " tout" "text": " tout"
}, },
{ {
@ -60,69 +60,70 @@
"text": " d'abord" "text": " d'abord"
} }
], ],
"seed": 0, "seed": 1,
"tokens": [ "tokens": [
{ {
"id": 578, "id": 2997,
"logprob": -1.6474609, "logprob": -4.4101562,
"special": false, "special": false,
"text": " le" "text": " vous"
}, },
{ {
"id": 5608, "id": 71256,
"logprob": -2.5097656, "logprob": -5.421875,
"special": false, "special": false,
"text": " faire" "text": " retrouver"
}, },
{ {
"id": 159570, "id": 693,
"logprob": -6.65625, "logprob": -2.1738281,
"special": false, "special": false,
"text": " réch" "text": " à"
}, },
{ {
"id": 810, "id": 366,
"logprob": 0.0, "logprob": -1.5322266,
"special": false, "special": false,
"text": "au" "text": " la"
}, },
{ {
"id": 12736, "id": 221398,
"logprob": 0.0, "logprob": -2.6640625,
"special": false, "special": false,
"text": "ffer" "text": " terrasse"
}, },
{ {
"id": 1742, "id": 1375,
"logprob": -2.5859375, "logprob": -4.375,
"special": false, "special": false,
"text": " au" "text": " pour"
}, },
{ {
"id": 6105, "id": 86887,
"logprob": -2.03125, "logprob": -4.8203125,
"special": false, "special": false,
"text": " bain" "text": " essayer"
}, },
{ {
"id": 88254, "id": 2155,
"logprob": -0.12695312, "logprob": -2.7421875,
"special": false, "special": false,
"text": "-mar" "text": " ce"
}, },
{ {
"id": 641, "id": 5743,
"logprob": 0.0, "logprob": -3.1757812,
"special": false, "special": false,
"text": "ie" "text": " jus"
}, },
{ {
"id": 2940, "id": 1479,
"logprob": -3.5175781, "logprob": -3.3554688,
"special": false, "special": false,
"text": " avec" "text": " qui"
} }
] ],
"top_tokens": null
}, },
"generated_text": " le faire réchauffer au bain-marie avec" "generated_text": " vous retrouver à la terrasse pour essayer ce jus qui"
} }

View File

@ -20,7 +20,7 @@
"text": " request" "text": " request"
} }
], ],
"seed": 0, "seed": 1,
"tokens": [ "tokens": [
{ {
"id": 7539, "id": 7539,
@ -35,20 +35,20 @@
"text": " are" "text": " are"
}, },
{ {
"id": 671, "id": 476,
"logprob": -1.703125, "logprob": -0.453125,
"special": false, "special": false,
"text": " an" "text": " a"
}, },
{ {
"id": 8727, "id": 2621,
"logprob": 0.0, "logprob": -2.078125,
"special": false, "special": false,
"text": " essential" "text": " key"
}, },
{ {
"id": 1702, "id": 1702,
"logprob": 0.0, "logprob": -0.20117188,
"special": false, "special": false,
"text": " part" "text": " part"
}, },
@ -64,26 +64,26 @@
"special": false, "special": false,
"text": " the" "text": " the"
}, },
{
"id": 11859,
"logprob": -1.6953125,
"special": false,
"text": " lab"
},
{ {
"id": 2185, "id": 2185,
"logprob": -1.3125, "logprob": -0.765625,
"special": false, "special": false,
"text": " process" "text": " process"
}, },
{ {
"id": 578, "id": 604,
"logprob": -1.5, "logprob": 0.0,
"special": false, "special": false,
"text": " and" "text": " for"
},
{
"id": 17583,
"logprob": -2.609375,
"special": false,
"text": " sending"
} }
], ],
"top_tokens": null "top_tokens": null
}, },
"generated_text": "Test request forms are an essential part of the lab process and" "generated_text": "Test request forms are a key part of the process for sending"
} }

View File

@ -1,8 +1,8 @@
{ {
"details": { "details": {
"best_of_sequences": null, "best_of_sequences": null,
"finish_reason": "stop_sequence", "finish_reason": "length",
"generated_tokens": 6, "generated_tokens": 10,
"prefill": [ "prefill": [
{ {
"id": 14402, "id": 14402,
@ -15,7 +15,7 @@
"text": " request" "text": " request"
} }
], ],
"seed": 0, "seed": 1,
"tokens": [ "tokens": [
{ {
"id": 284, "id": 284,
@ -24,37 +24,61 @@
"text": " to" "text": " to"
}, },
{ {
"id": 3758, "id": 262,
"logprob": -0.62597656, "logprob": -2.0957031,
"special": false, "special": false,
"text": " send" "text": " the"
}, },
{ {
"id": 1366, "id": 7824,
"logprob": -0.87060547, "logprob": 0.0,
"special": false, "special": false,
"text": " data" "text": " API"
}, },
{ {
"id": 625, "id": 198,
"logprob": -0.88427734, "logprob": -1.4794922,
"special": false, "special": false,
"text": " over" "text": "\n"
}, },
{ {
"id": 257, "id": 50280,
"logprob": -1.0830078, "logprob": 0.0,
"special": false, "special": false,
"text": " a" "text": " "
}, },
{ {
"id": 3127, "id": 37811,
"logprob": -1.9462891, "logprob": 0.0,
"special": false, "special": false,
"text": " network" "text": "\"\"\""
},
{
"id": 628,
"logprob": 0.0,
"special": false,
"text": "\n\n"
},
{
"id": 50284,
"logprob": 0.0,
"special": false,
"text": " "
},
{
"id": 4299,
"logprob": 0.0,
"special": false,
"text": "def"
},
{
"id": 1332,
"logprob": -1.7158203,
"special": false,
"text": " test"
} }
], ],
"top_tokens": null "top_tokens": null
}, },
"generated_text": "Test request to send data over a network" "generated_text": "Test request to the API\n \"\"\"\n\n def test"
} }

View File

@ -30,7 +30,7 @@
"text": " " "text": " "
} }
], ],
"seed": 0, "seed": 1,
"tokens": [ "tokens": [
{ {
"id": 187, "id": 187,
@ -39,22 +39,22 @@
"text": "\n" "text": "\n"
}, },
{ {
"id": 395, "id": 11863,
"logprob": -0.3125, "logprob": -1.3125,
"special": false, "special": false,
"text": "and" "text": "blue"
}, },
{ {
"id": 4797, "id": 285,
"logprob": -1.1015625,
"special": false,
"text": " and"
},
{
"id": 4759,
"logprob": 0.0, "logprob": 0.0,
"special": false, "special": false,
"text": " blue" "text": " green"
},
{
"id": 9830,
"logprob": -1.65625,
"special": false,
"text": " colors"
}, },
{ {
"id": 15, "id": 15,
@ -63,16 +63,16 @@
"text": "." "text": "."
}, },
{ {
"id": 329, "id": 380,
"logprob": -2.4375, "logprob": -1.65625,
"special": false, "special": false,
"text": " A" "text": " The"
}, },
{ {
"id": 1180, "id": 3295,
"logprob": -1.953125, "logprob": -0.45117188,
"special": false, "special": false,
"text": " number" "text": " color"
}, },
{ {
"id": 273, "id": 273,
@ -81,19 +81,19 @@
"text": " of" "text": " of"
}, },
{ {
"id": 1027, "id": 253,
"logprob": -1.5546875, "logprob": 0.0,
"special": false, "special": false,
"text": " different" "text": " the"
}, },
{ {
"id": 3295, "id": 2329,
"logprob": -0.97265625, "logprob": -3.125,
"special": false, "special": false,
"text": " color" "text": " air"
} }
], ],
"top_tokens": null "top_tokens": null
}, },
"generated_text": "blue, red, yellow, \nand blue colors. A number of different color" "generated_text": "blue, red, yellow, \nblue and green. The color of the air"
} }

View File

@ -3,7 +3,7 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def flash_gemma_handle(launcher): def flash_gemma_handle(launcher):
with launcher("gg-hf/gemma-2b", num_shard=1) as handle: with launcher("google/gemma-2b", num_shard=1) as handle:
yield handle yield handle
@ -13,7 +13,7 @@ async def flash_gemma(flash_gemma_handle):
return flash_gemma_handle.client return flash_gemma_handle.client
# @pytest.mark.skip @pytest.mark.skip
@pytest.mark.asyncio @pytest.mark.asyncio
@pytest.mark.private @pytest.mark.private
async def test_flash_gemma(flash_gemma, response_snapshot): async def test_flash_gemma(flash_gemma, response_snapshot):
@ -25,7 +25,7 @@ async def test_flash_gemma(flash_gemma, response_snapshot):
assert response == response_snapshot assert response == response_snapshot
# @pytest.mark.skip @pytest.mark.skip
@pytest.mark.asyncio @pytest.mark.asyncio
@pytest.mark.private @pytest.mark.private
async def test_flash_gemma_all_params(flash_gemma, response_snapshot): async def test_flash_gemma_all_params(flash_gemma, response_snapshot):

View File

@ -42,8 +42,11 @@ async def test_flash_phi_all_params(flash_phi, response_snapshot):
seed=1, seed=1,
) )
assert response.details.generated_tokens == 6 assert response.details.generated_tokens == 10
assert response.generated_text == "Test request to send data over a network" assert (
response.generated_text
== 'Test request to the API\n """\n\n def test'
)
assert response == response_snapshot assert response == response_snapshot

View File

@ -45,7 +45,7 @@ async def test_mamba_all_params(fused_kernel_mamba, response_snapshot):
assert response.details.generated_tokens == 10 assert response.details.generated_tokens == 10
assert ( assert (
response.generated_text response.generated_text
== "blue, red, yellow, \nand blue colors. A number of different color" == "blue, red, yellow, \nblue and green. The color of the air"
) )
assert response == response_snapshot assert response == response_snapshot

View File

@ -23,7 +23,7 @@ async def test_mt0_base(mt0_base, response_snapshot):
seed=1, seed=1,
) )
assert response.details.generated_tokens == 5 assert response.details.generated_tokens == 7
assert response == response_snapshot assert response == response_snapshot