File tree 3 files changed +3
-3
lines changed
3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ def __init__(self, use_gpu: bool = False):
87
87
),
88
88
)
89
89
if use_gpu :
90
- self ._model .cuda ()
90
+ self ._model = self . _model .cuda ()
91
91
92
92
def translate (self , text : str ) -> str :
93
93
"""
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ def __init__(
49
49
self .tokenizer_thzh = AutoTokenizer .from_pretrained (pretrained )
50
50
self .model_thzh = AutoModelForSeq2SeqLM .from_pretrained (pretrained )
51
51
if use_gpu :
52
- self .model_thzh .cuda ()
52
+ self .model_thzh = self . model_thzh .cuda ()
53
53
54
54
def translate (self , text : str ) -> str :
55
55
"""
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def __init__(
43
43
self .tokenizer_thzh = AutoTokenizer .from_pretrained (pretrained )
44
44
self .model_thzh = AutoModelForSeq2SeqLM .from_pretrained (pretrained )
45
45
if use_gpu :
46
- self .model_thzh .cuda ()
46
+ self .model_thzh = self . model_thzh .cuda ()
47
47
48
48
def translate (self , text : str ) -> str :
49
49
"""
You can’t perform that action at this time.
0 commit comments