Skip to content

Commit c86f58d

Browse files
feat: add support for Gemma (#1583)
1 parent fa8a8e0 commit c86f58d

File tree

8 files changed

+1338
-0
lines changed

8 files changed

+1338
-0
lines changed

integration-tests/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ def serialize(
4040
exclude=None,
4141
matcher=None,
4242
):
43+
if isinstance(data, Response):
44+
data = data.dict()
45+
4346
if isinstance(data, List):
4447
data = [d.dict() for d in data]
4548

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"details": {
3+
"best_of_sequences": null,
4+
"finish_reason": "length",
5+
"generated_tokens": 10,
6+
"prefill": [
7+
{
8+
"id": 2,
9+
"logprob": null,
10+
"text": "<bos>"
11+
},
12+
{
13+
"id": 2015,
14+
"logprob": -10.0,
15+
"text": "Test"
16+
},
17+
{
18+
"id": 3853,
19+
"logprob": -10.875,
20+
"text": " request"
21+
}
22+
],
23+
"seed": null,
24+
"tokens": [
25+
{
26+
"id": 1736,
27+
"logprob": -2.09375,
28+
"special": false,
29+
"text": " form"
30+
},
31+
{
32+
"id": 109,
33+
"logprob": -1.8671875,
34+
"special": false,
35+
"text": "\n\n"
36+
},
37+
{
38+
"id": 651,
39+
"logprob": -2.4375,
40+
"special": false,
41+
"text": "The"
42+
},
43+
{
44+
"id": 2121,
45+
"logprob": -1.8203125,
46+
"special": false,
47+
"text": " test"
48+
},
49+
{
50+
"id": 3853,
51+
"logprob": -0.23242188,
52+
"special": false,
53+
"text": " request"
54+
},
55+
{
56+
"id": 1736,
57+
"logprob": -0.08544922,
58+
"special": false,
59+
"text": " form"
60+
},
61+
{
62+
"id": 603,
63+
"logprob": -0.9375,
64+
"special": false,
65+
"text": " is"
66+
},
67+
{
68+
"id": 1671,
69+
"logprob": -1.671875,
70+
"special": false,
71+
"text": " used"
72+
},
73+
{
74+
"id": 577,
75+
"logprob": -0.40429688,
76+
"special": false,
77+
"text": " to"
78+
},
79+
{
80+
"id": 3853,
81+
"logprob": -1.1875,
82+
"special": false,
83+
"text": " request"
84+
}
85+
],
86+
"top_tokens": null
87+
},
88+
"generated_text": " form\n\nThe test request form is used to request"
89+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"details": {
3+
"best_of_sequences": null,
4+
"finish_reason": "length",
5+
"generated_tokens": 10,
6+
"prefill": [
7+
{
8+
"id": 2,
9+
"logprob": null,
10+
"text": "<bos>"
11+
},
12+
{
13+
"id": 2015,
14+
"logprob": -10.0,
15+
"text": "Test"
16+
},
17+
{
18+
"id": 3853,
19+
"logprob": -10.875,
20+
"text": " request"
21+
}
22+
],
23+
"seed": 0,
24+
"tokens": [
25+
{
26+
"id": 7539,
27+
"logprob": -0.73046875,
28+
"special": false,
29+
"text": " forms"
30+
},
31+
{
32+
"id": 708,
33+
"logprob": 0.0,
34+
"special": false,
35+
"text": " are"
36+
},
37+
{
38+
"id": 671,
39+
"logprob": -1.703125,
40+
"special": false,
41+
"text": " an"
42+
},
43+
{
44+
"id": 8727,
45+
"logprob": 0.0,
46+
"special": false,
47+
"text": " essential"
48+
},
49+
{
50+
"id": 1702,
51+
"logprob": 0.0,
52+
"special": false,
53+
"text": " part"
54+
},
55+
{
56+
"id": 576,
57+
"logprob": 0.0,
58+
"special": false,
59+
"text": " of"
60+
},
61+
{
62+
"id": 573,
63+
"logprob": 0.0,
64+
"special": false,
65+
"text": " the"
66+
},
67+
{
68+
"id": 11859,
69+
"logprob": -1.6953125,
70+
"special": false,
71+
"text": " lab"
72+
},
73+
{
74+
"id": 2185,
75+
"logprob": -1.3125,
76+
"special": false,
77+
"text": " process"
78+
},
79+
{
80+
"id": 578,
81+
"logprob": -1.5,
82+
"special": false,
83+
"text": " and"
84+
}
85+
],
86+
"top_tokens": null
87+
},
88+
"generated_text": "Test request forms are an essential part of the lab process and"
89+
}

0 commit comments

Comments
 (0)