Update handler.py
Browse files- handler.py +4 -4
handler.py
CHANGED
|
@@ -59,6 +59,10 @@ class EndpointHandler:
|
|
| 59 |
"hate_speech": decoded_hate_speech
|
| 60 |
}
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
# Define your custom multitask model architecture here
|
| 63 |
class MultitaskDebertaModel(nn.Module):
|
| 64 |
def __init__(self, num_emotion_labels, num_polarity_labels, num_hate_speech_labels):
|
|
@@ -142,7 +146,3 @@ class MultitaskDebertaModel(nn.Module):
|
|
| 142 |
'polarity': polarity_logits,
|
| 143 |
'hate_speech': hate_speech_logits
|
| 144 |
}
|
| 145 |
-
|
| 146 |
-
def load_model(self, model_path):
|
| 147 |
-
#Load model weights from the specified path
|
| 148 |
-
self.load_state_dict(torch.load(model_path))
|
|
|
|
| 59 |
"hate_speech": decoded_hate_speech
|
| 60 |
}
|
| 61 |
|
| 62 |
+
def load_model(self, model_path):
|
| 63 |
+
#Load model weights from the specified path
|
| 64 |
+
self.load_state_dict(torch.load(model_path))
|
| 65 |
+
|
| 66 |
# Define your custom multitask model architecture here
|
| 67 |
class MultitaskDebertaModel(nn.Module):
|
| 68 |
def __init__(self, num_emotion_labels, num_polarity_labels, num_hate_speech_labels):
|
|
|
|
| 146 |
'polarity': polarity_logits,
|
| 147 |
'hate_speech': hate_speech_logits
|
| 148 |
}
|
|
|
|
|
|
|
|
|
|
|
|