Text Summarization, Generative Ai Tools, Artificial Intelligence, Machine Learning Ai, Hugging Face.
torch.no_grad(): generated_tokens = accelerator.unwrap_model(model).generate(batch["input_ids"], attention_mask=batch["attention_mask"],**gen_kwargs,) generated_tokens = accelerator.pad_across_processes(generated_tokens, dim=1, pad_index=tokenizer.pad_token_id) labels = batch["labels"] if not