From ef786e98640f2f0e1d084ddfeb9429d832407a7f Mon Sep 17 00:00:00 2001 From: Michael Feil <63565275+michaelfeil@users.noreply.github.com> Date: Fri, 15 Mar 2024 02:30:33 -0700 Subject: [PATCH] Update chronos.py - model.device (#11) *Issue #, if available:* N/A *Description of changes:* Thanks for the very clean impl of the Model, Tokenizer, and Pipeline. I was curios about it and found a minor improvement in the API - what do you think about it? Feel free to close. Change is untested. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --- src/chronos/chronos.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chronos/chronos.py b/src/chronos/chronos.py index efa6bbf..2beb957 100644 --- a/src/chronos/chronos.py +++ b/src/chronos/chronos.py @@ -204,7 +204,10 @@ def __init__(self, config: ChronosConfig, model: PreTrainedModel) -> None: super().__init__() self.config = config self.model = model - self.device = model.device + + @property + def device(self): + return self.model.device def forward( self,