Skip to content

Commit

Permalink
Fix attribute-context for current preceding context in input
Browse files Browse the repository at this point in the history
  • Loading branch information
gsarti committed Feb 27, 2024
1 parent 1e29045 commit dc969bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inseq/commands/attribute_context/attribute_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ def attribute_context_with_model(args: AttributeContextArgs, model: HuggingfaceM
args.generation_kwargs["forced_bos_token_id"] = model.tokenizer.lang_code_to_id[tgt_lang]

# Prepare input/outputs (generate if necessary)
input_full_text = format_template(args.input_template, args.input_current_text, args.input_context_text)
if "{current}" in args.contextless_input_current_text:
args.input_current_text = args.contextless_input_current_text.format(current=args.input_current_text)
else:
args.input_current_text = args.contextless_input_current_text
input_full_text = format_template(args.input_template, args.input_current_text, args.input_context_text)
args.output_context_text, args.output_current_text = prepare_outputs(
model=model,
input_context_text=args.input_context_text,
Expand Down

0 comments on commit dc969bd

Please sign in to comment.