Commit
•
1f7a2e3
1
Parent(s):
c2f9b04
Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
@@ -5,8 +5,8 @@ import torch
|
|
5 |
class EndpointHandler:
|
6 |
def __init__(self, path=""):
|
7 |
# load model and processor from path
|
8 |
-
|
9 |
-
|
10 |
|
11 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, str]:
|
12 |
"""
|
|
|
5 |
class EndpointHandler:
|
6 |
def __init__(self, path=""):
|
7 |
# load model and processor from path
|
8 |
+
self.processor = AutoProcessor.from_pretrained(path)
|
9 |
+
self.model = MusicgenForConditionalGeneration.from_pretrained(path, torch_dtype=torch.float16).to("cuda")
|
10 |
|
11 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, str]:
|
12 |
"""
|