mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 20:34:54 +00:00
Fixing the text part from tokenizer endpoint.
This commit is contained in:
parent
e76b9824ae
commit
847536d9c7
@ -1333,7 +1333,8 @@ async fn tokenize(
|
|||||||
.iter()
|
.iter()
|
||||||
.zip(encoding.get_offsets())
|
.zip(encoding.get_offsets())
|
||||||
.map(|(&id, &(start, stop))| {
|
.map(|(&id, &(start, stop))| {
|
||||||
let text: String = input.chars().skip(start).take(stop - start).collect();
|
let text: String =
|
||||||
|
String::from_utf8_lossy(&input.as_bytes()[start..stop]).to_string();
|
||||||
SimpleToken {
|
SimpleToken {
|
||||||
id,
|
id,
|
||||||
text,
|
text,
|
||||||
|
Loading…
Reference in New Issue
Block a user