Update handler.py
Browse files- handler.py +4 -1
handler.py
CHANGED
|
@@ -3,7 +3,10 @@ from gliner import GLiNER
|
|
| 3 |
class EndpointHandler:
|
| 4 |
def __init__(self, path=""):
|
| 5 |
# Use the provided path for loading the model
|
| 6 |
-
self.model = GLiNER.from_pretrained(
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def __call__(self, data):
|
| 9 |
# If data is wrapped in 'inputs' (as Hugging Face does), unwrap it
|
|
|
|
| 3 |
class EndpointHandler:
|
| 4 |
def __init__(self, path=""):
|
| 5 |
# Use the provided path for loading the model
|
| 6 |
+
self.model = GLiNER.from_pretrained(
|
| 7 |
+
path,
|
| 8 |
+
device_map="cuda"
|
| 9 |
+
)
|
| 10 |
|
| 11 |
def __call__(self, data):
|
| 12 |
# If data is wrapped in 'inputs' (as Hugging Face does), unwrap it
|