VascoBartolo
commited on
Commit
·
5220a75
1
Parent(s):
776aee4
fix import for the model
Browse files- handler.py +3 -3
handler.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
from typing import Dict, List, Any
|
2 |
import torch
|
3 |
-
from transformers import
|
4 |
|
5 |
class EndpointHandler:
|
6 |
def __init__(self, path=""):
|
7 |
# Adjust the loading process to handle potential configuration mismatches
|
8 |
-
self.model =
|
9 |
path
|
10 |
)
|
11 |
-
self.processor =
|
12 |
|
13 |
# Ensure the model is in evaluation mode
|
14 |
self.model.eval()
|
|
|
1 |
from typing import Dict, List, Any
|
2 |
import torch
|
3 |
+
from transformers import AutoModelForSeq2SeqLM, AutoProcessor
|
4 |
|
5 |
class EndpointHandler:
|
6 |
def __init__(self, path=""):
|
7 |
# Adjust the loading process to handle potential configuration mismatches
|
8 |
+
self.model = AutoModelForSeq2SeqLM.from_pretrained(
|
9 |
path
|
10 |
)
|
11 |
+
self.processor = AutoProcessor.from_pretrained(path)
|
12 |
|
13 |
# Ensure the model is in evaluation mode
|
14 |
self.model.eval()
|