From 9393b17a2fc289a8d036b3ce38fef289aa84f8c0 Mon Sep 17 00:00:00 2001 From: Jack-Khuu Date: Tue, 21 Jan 2025 15:59:15 -0800 Subject: [PATCH 1/2] Add warning in PTEModel when not defined --- torchchat/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/torchchat/model.py b/torchchat/model.py index f50d2a8be..277d854db 100644 --- a/torchchat/model.py +++ b/torchchat/model.py @@ -1062,5 +1062,6 @@ def forward(self, x, input_pos): def setup_caches(self, max_batch_size, max_seq_length): pass -except: +except Exception as e: + print(f"Warning: PTEModel (ExecuTorch not available with exception: {e}") pass From f227f2e8a69394fc67383d4480c280ce0e2f1370 Mon Sep 17 00:00:00 2001 From: Jack-Khuu Date: Tue, 21 Jan 2025 16:43:14 -0800 Subject: [PATCH 2/2] Add missing parans --- torchchat/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchchat/model.py b/torchchat/model.py index 277d854db..28429370c 100644 --- a/torchchat/model.py +++ b/torchchat/model.py @@ -1063,5 +1063,5 @@ def setup_caches(self, max_batch_size, max_seq_length): pass except Exception as e: - print(f"Warning: PTEModel (ExecuTorch not available with exception: {e}") + print(f"Warning: PTEModel (ExecuTorch) not available with exception: {e}") pass