Skip to content

Commit

Permalink
Update chronos.py - model.device (#11)
Browse files Browse the repository at this point in the history
*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.
  • Loading branch information
michaelfeil authored Mar 15, 2024
1 parent 7ba945c commit ef786e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/chronos/chronos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ef786e9

Please sign in to comment.