Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
|
2 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
class EndpointHandler:
|
6 |
-
def __init__(self,
|
7 |
self.tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
|
8 |
self.model = AutoModelForSequenceClassification.from_pretrained(model_name_or_path)
|
9 |
self.model.eval() # Set the model to evaluation mode
|
|
|
1 |
+
model_name="alfaxadeyembe/gemma2-27b-swahili-it"
|
2 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
class EndpointHandler:
|
6 |
+
def __init__(self, model_name):
|
7 |
self.tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
|
8 |
self.model = AutoModelForSequenceClassification.from_pretrained(model_name_or_path)
|
9 |
self.model.eval() # Set the model to evaluation mode
|