Compilation fix: Correct method argument types in generation.rs and validation.rs (#10)
* fix: Correct method argument types in generation and validation In the `generation.rs` and `validation.rs` files, corrected the argument types passed to the `decode` method. Replaced `Vec<u32>` with `&[u32]` using the `as_ref()` method to match the expected argument types. This resolves the mismatched types compilation error during the Rust build process. Closes [#9](https://github.com/Preemo-Inc/text-generation-inference/issues/9) * Update benchmark/src/generation.rs Co-authored-by: Yang, Bo <pop.atry@gmail.com> * Update router/src/validation.rs Co-authored-by: Yang, Bo <pop.atry@gmail.com> --------- Co-authored-by: Yang, Bo <pop.atry@gmail.com>
This commit is contained in:
parent
d2ae3581bf
commit
1e646fb41d
|
@ -218,6 +218,6 @@ fn create_sequence(sequence_length: u32, tokenizer: Tokenizer) -> String {
|
|||
encoding.truncate(sequence_length as usize, 0, TruncationDirection::Left);
|
||||
// Decode
|
||||
tokenizer
|
||||
.decode(Vec::from(encoding.get_ids()), false)
|
||||
.decode(From::from(encoding.get_ids()), false)
|
||||
.unwrap()
|
||||
}
|
||||
|
|
|
@ -311,7 +311,7 @@ fn prepare_input(
|
|||
// truncate encoding and decode new inputs
|
||||
encoding.truncate(truncate, 0, TruncationDirection::Left);
|
||||
let inputs = tokenizer
|
||||
.decode(Vec::from(encoding.get_ids()), false)
|
||||
.decode(From::from(encoding.get_ids()), false)
|
||||
.map_err(|err| ValidationError::Tokenizer(err.to_string()))?;
|
||||
(inputs, encoding.len())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue