Commit
·
4dd8948
1
Parent(s):
ab072a7
Changes to handler
Browse files- handler.py +3 -3
handler.py
CHANGED
@@ -3,8 +3,8 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
3 |
|
4 |
MODEL_NAME = "kasterkeqi/Lumo-8B-Fork-Sol-Copilot"
|
5 |
|
6 |
-
class
|
7 |
-
def __init__(self):
|
8 |
"""Initialize the model and tokenizer."""
|
9 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
print(f"Loading model on {self.device}...")
|
@@ -32,4 +32,4 @@ class ModelHandler:
|
|
32 |
|
33 |
# Decode output
|
34 |
response = self.tokenizer.decode(output_tokens[0], skip_special_tokens=True)
|
35 |
-
return {"response": response}
|
|
|
3 |
|
4 |
MODEL_NAME = "kasterkeqi/Lumo-8B-Fork-Sol-Copilot"
|
5 |
|
6 |
+
class EndpointHandler:
|
7 |
+
def __init__(self, model_dir=None):
|
8 |
"""Initialize the model and tokenizer."""
|
9 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
print(f"Loading model on {self.device}...")
|
|
|
32 |
|
33 |
# Decode output
|
34 |
response = self.tokenizer.decode(output_tokens[0], skip_special_tokens=True)
|
35 |
+
return {"response": response}
|