Update mt0 (not more truncating).

This commit is contained in:
Nicolas Patry 2024-04-09 13:11:25 +00:00
parent 2283562bfc
commit 61821f410a
3 changed files with 40 additions and 23 deletions

View File

@ -1,8 +1,8 @@
{ {
"details": { "details": {
"best_of_sequences": null, "best_of_sequences": null,
"finish_reason": "eos_token", "finish_reason": "length",
"generated_tokens": 9, "generated_tokens": 10,
"prefill": [ "prefill": [
{ {
"id": 0, "id": 0,
@ -14,7 +14,7 @@
"tokens": [ "tokens": [
{ {
"id": 16017, "id": 16017,
"logprob": -0.30908203, "logprob": 0.0,
"special": false, "special": false,
"text": " blue" "text": " blue"
}, },
@ -26,39 +26,45 @@
}, },
{ {
"id": 259, "id": 259,
"logprob": -0.28271484, "logprob": -0.4716797,
"special": false, "special": false,
"text": " " "text": " "
}, },
{ {
"id": 15484, "id": 261,
"logprob": -1.7929688, "logprob": -0.044677734,
"special": false, "special": false,
"text": "appear" "text": ","
}, },
{ {
"id": 345, "id": 35622,
"logprob": -0.8935547, "logprob": -0.79589844,
"special": false, "special": false,
"text": "ed" "text": " cloud"
}, },
{ {
"id": 281, "id": 263,
"logprob": -1.2958984,
"special": false,
"text": "s"
},
{
"id": 305,
"logprob": 0.0, "logprob": 0.0,
"special": false, "special": false,
"text": " in" "text": " and"
}, },
{ {
"id": 287, "id": 35622,
"logprob": -1.1630859,
"special": false,
"text": " cloud"
},
{
"id": 263,
"logprob": 0.0, "logprob": 0.0,
"special": false, "special": false,
"text": " the" "text": "s"
},
{
"id": 20495,
"logprob": -0.32299805,
"special": false,
"text": " sky"
}, },
{ {
"id": 1, "id": 1,
@ -66,7 +72,8 @@
"special": true, "special": true,
"text": "</s>" "text": "</s>"
} }
] ],
"top_tokens": null
}, },
"generated_text": "Why is the sky blue?blue sky appeared in the sky" "generated_text": "Why is the sky blue?blue sky, clouds and clouds"
} }

View File

@ -45,7 +45,7 @@ async def test_mt0_base_all_params(mt0_base, response_snapshot):
seed=0, seed=0,
) )
assert response.details.generated_tokens == 9 assert response.details.generated_tokens == 10
assert response == response_snapshot assert response == response_snapshot

View File

@ -646,9 +646,11 @@ mod tests {
let max_total_tokens = 6; let max_total_tokens = 6;
let workers = 1; let workers = 1;
let disable_grammar_support = true; let disable_grammar_support = true;
let config = None;
let validation = Validation::new( let validation = Validation::new(
workers, workers,
tokenizer, tokenizer,
config,
max_best_of, max_best_of,
max_stop_sequence, max_stop_sequence,
max_top_n_tokens, max_top_n_tokens,
@ -677,9 +679,11 @@ mod tests {
let max_total_tokens = 6; let max_total_tokens = 6;
let disable_grammar_support = true; let disable_grammar_support = true;
let workers = 1; let workers = 1;
let config = None;
let validation = Validation::new( let validation = Validation::new(
workers, workers,
tokenizer, tokenizer,
config,
max_best_of, max_best_of,
max_stop_sequence, max_stop_sequence,
max_top_n_tokens, max_top_n_tokens,
@ -708,9 +712,11 @@ mod tests {
let max_total_tokens = 6; let max_total_tokens = 6;
let workers = 1; let workers = 1;
let disable_grammar_support = true; let disable_grammar_support = true;
let config = None;
let validation = Validation::new( let validation = Validation::new(
workers, workers,
tokenizer, tokenizer,
config,
max_best_of, max_best_of,
max_stop_sequence, max_stop_sequence,
max_top_n_tokens, max_top_n_tokens,
@ -744,9 +750,11 @@ mod tests {
let max_total_tokens = 106; let max_total_tokens = 106;
let workers = 1; let workers = 1;
let disable_grammar_support = true; let disable_grammar_support = true;
let config = None;
let validation = Validation::new( let validation = Validation::new(
workers, workers,
tokenizer, tokenizer,
config,
max_best_of, max_best_of,
max_stop_sequence, max_stop_sequence,
max_top_n_tokens, max_top_n_tokens,
@ -809,9 +817,11 @@ mod tests {
let max_total_tokens = 106; let max_total_tokens = 106;
let workers = 1; let workers = 1;
let disable_grammar_support = true; let disable_grammar_support = true;
let config = None;
let validation = Validation::new( let validation = Validation::new(
workers, workers,
tokenizer, tokenizer,
config,
max_best_of, max_best_of,
max_stop_sequences, max_stop_sequences,
max_top_n_tokens, max_top_n_tokens,