Skip to content

Commit

Permalink
fix: return tokens as string hf api (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorr1 authored Jan 16, 2024
1 parent eb7e6fa commit 637fb14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manifest/api/models/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ def __call__(
"logprobs": logits[
range(num_generated_tokens), i, output_seq[-num_generated_tokens:]
].tolist(),
"tokens": output_seq[-num_generated_tokens:].tolist(),
"tokens": self.tokenizer.convert_ids_to_tokens(
output_seq[-num_generated_tokens:].tolist()
),
}
for i, output_seq in enumerate(output_dict.sequences)
]
Expand Down

0 comments on commit 637fb14

Please sign in to comment.