ikeno-ada commited on
Commit
6ec120b
·
verified ·
1 Parent(s): 24a9fb3

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +1 -1
handler.py CHANGED
@@ -21,7 +21,7 @@ class EndpointHandler():
21
 
22
  # tokenize the input
23
  encoded = tokenizer(text, return_tensors="pt")
24
- encoded = encoded.to('cuda')
25
  # run the model
26
  generated_tokens = model.generate(**encoded, forced_bos_token_id=tokenizer.get_lang_id(langId))
27
  result = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)[0]
 
21
 
22
  # tokenize the input
23
  encoded = tokenizer(text, return_tensors="pt")
24
+ encoded = encoded.to(model.device)
25
  # run the model
26
  generated_tokens = model.generate(**encoded, forced_bos_token_id=tokenizer.get_lang_id(langId))
27
  result = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)[0]