Update handler.py
Browse files- handler.py +2 -4
handler.py
CHANGED
@@ -22,9 +22,6 @@ class EndpointHandler():
|
|
22 |
# Move the pipeline to the appropriate device (CPU or GPU)
|
23 |
self.pipeline.to(torch.device("cuda" if torch.cuda.is_available() else "cpu"))
|
24 |
|
25 |
-
# Instantiate the pipeline with its parameters
|
26 |
-
self.pipeline = self.pipeline.instantiate(self.pipeline.parameters)
|
27 |
-
|
28 |
def __call__(self, data: Dict) -> Dict:
|
29 |
"""
|
30 |
Args:
|
@@ -35,7 +32,7 @@ class EndpointHandler():
|
|
35 |
Dict: Speaker diarization results
|
36 |
"""
|
37 |
inputs = data.get("inputs")
|
38 |
-
parameters = data.get("parameters", {}) #
|
39 |
|
40 |
# Decode the base64 audio data
|
41 |
audio_data = base64.b64decode(inputs)
|
@@ -70,3 +67,4 @@ class EndpointHandler():
|
|
70 |
]
|
71 |
return {"diarization": processed_diarization}
|
72 |
|
|
|
|
22 |
# Move the pipeline to the appropriate device (CPU or GPU)
|
23 |
self.pipeline.to(torch.device("cuda" if torch.cuda.is_available() else "cpu"))
|
24 |
|
|
|
|
|
|
|
25 |
def __call__(self, data: Dict) -> Dict:
|
26 |
"""
|
27 |
Args:
|
|
|
32 |
Dict: Speaker diarization results
|
33 |
"""
|
34 |
inputs = data.get("inputs")
|
35 |
+
parameters = data.get("parameters", {}) # Currently not using them
|
36 |
|
37 |
# Decode the base64 audio data
|
38 |
audio_data = base64.b64decode(inputs)
|
|
|
67 |
]
|
68 |
return {"diarization": processed_diarization}
|
69 |
|
70 |
+
|