From 4df8d49c15f3868b160c6afb582487c2fdd91390 Mon Sep 17 00:00:00 2001 From: Toolkit User Date: Wed, 10 May 2023 10:44:16 +0000 Subject: [PATCH] Fix: Using tensor with dummy value rather than None for the temperature in the mlm case. --- .gitignore | 6 +++--- src/hf_trainer.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 5a15f24..60dca44 100644 --- a/.gitignore +++ b/.gitignore @@ -134,6 +134,6 @@ wandb-debug.log wandb/ # hf -cache- -.lock -.arrow +*cache-* +*.lock +*.arrow diff --git a/src/hf_trainer.py b/src/hf_trainer.py index 0e7564c..27f8090 100644 --- a/src/hf_trainer.py +++ b/src/hf_trainer.py @@ -119,7 +119,7 @@ def compute_loss( try: temp_coef = temp_coef_fn.get_temp_coef() except AttributeError: - temp_coef = None + temp_coef = torch.Tensor([0.0]).to(contrastive_loss.device) return contrastive_loss, { "source_embedding": normalized_source_embedding,