Reyad-Ahmmed commited on
Commit
808c660
·
verified ·
1 Parent(s): 262130c

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +1 -1
handler.py CHANGED
@@ -25,7 +25,7 @@ class EndpointHandler:
25
  model_name = model_dir2 #"./json_extraction_all" # Pretrained model for sentiment analysis
26
  self.tokenizer = T5Tokenizer.from_pretrained(model_name)
27
 
28
- self.model = T5ForConditionalGeneration.from_pretrained(model_name)
29
  self.model.eval() # Set model to evaluation mode (no training)
30
 
31
  # Check if the model is on GPU
 
25
  model_name = model_dir2 #"./json_extraction_all" # Pretrained model for sentiment analysis
26
  self.tokenizer = T5Tokenizer.from_pretrained(model_name)
27
 
28
+ self.model = T5ForConditionalGeneration.from_pretrained(model_name, device_map="auto")
29
  self.model.eval() # Set model to evaluation mode (no training)
30
 
31
  # Check if the model is on GPU