Update handler.py
Browse files- 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
|