Skip to content

Commit ef786e9

Browse files
authored
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.
1 parent 7ba945c commit ef786e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/chronos/chronos.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ def __init__(self, config: ChronosConfig, model: PreTrainedModel) -> None:
204204
super().__init__()
205205
self.config = config
206206
self.model = model
207-
self.device = model.device
207+
208+
@property
209+
def device(self):
210+
return self.model.device
208211

209212
def forward(
210213
self,

0 commit comments

Comments
 (0)