Skip to content

Commit

Permalink
Strip prepended whitespace in
Browse files Browse the repository at this point in the history
  • Loading branch information
gsarti committed Mar 14, 2024
1 parent a960309 commit a7f77fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inseq/commands/attribute_context/attribute_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ def attribute_context_with_model(args: AttributeContextArgs, model: HuggingfaceM
)
# Part 2: Contextual Cues Imputation (CCI)
for cci_step_idx, (cti_idx, cti_score, cti_tok) in enumerate(cti_ranked_tokens):
contextual_input = model.convert_tokens_to_string(input_full_tokens, skip_special_tokens=False)
contextual_input = model.convert_tokens_to_string(input_full_tokens, skip_special_tokens=False).lstrip(" ")
contextual_output = model.convert_tokens_to_string(
output_full_tokens[: output_current_text_offset + cti_idx + 1], skip_special_tokens=False
)
).lstrip(" ")
if not contextual_output:
contextual_output = output_full_tokens[output_current_text_offset + cti_idx]

Expand Down

0 comments on commit a7f77fd

Please sign in to comment.