From 01925bbdf76873c5cf3753dc4c5c352e7002057d Mon Sep 17 00:00:00 2001 From: Joshua David Date: Thu, 13 Jun 2024 21:53:04 -0700 Subject: [PATCH] Fix TypeError in non_uniform_interpolation --- src/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.py b/src/main.py index 82495bc..743fa54 100644 --- a/src/main.py +++ b/src/main.py @@ -39,6 +39,10 @@ def non_uniform_interpolation(pos_embed, extension_ratio, lambda_factors, n_hat) Returns: torch.Tensor: Interpolated position embeddings. """ + + if extension_ratio is None: + raise ValueError("extension_ratio cannot be None") + d_model = pos_embed.shape[-1] interpolated_pos = pos_embed.clone()