Update handler.py
Browse files- handler.py +1 -2
handler.py
CHANGED
|
@@ -2,7 +2,7 @@ from typing import Dict, List, Any
|
|
| 2 |
from gliner import GLiNER
|
| 3 |
|
| 4 |
class EndpointHandler:
|
| 5 |
-
def __init__(self, path="
|
| 6 |
# Initialize the GLiNER model
|
| 7 |
self.model = GLiNER.from_pretrained("urchade/gliner_multi-v2.1")
|
| 8 |
|
|
@@ -19,7 +19,6 @@ class EndpointHandler:
|
|
| 19 |
# Get inputs and labels
|
| 20 |
inputs = data.get("inputs", "")
|
| 21 |
labels = ["party", "document title"]
|
| 22 |
-
print('path', path)
|
| 23 |
print('labels',labels)
|
| 24 |
# Predict entities using GLiNER
|
| 25 |
entities = self.model.predict_entities(inputs, labels)
|
|
|
|
| 2 |
from gliner import GLiNER
|
| 3 |
|
| 4 |
class EndpointHandler:
|
| 5 |
+
def __init__(self, path=""):
|
| 6 |
# Initialize the GLiNER model
|
| 7 |
self.model = GLiNER.from_pretrained("urchade/gliner_multi-v2.1")
|
| 8 |
|
|
|
|
| 19 |
# Get inputs and labels
|
| 20 |
inputs = data.get("inputs", "")
|
| 21 |
labels = ["party", "document title"]
|
|
|
|
| 22 |
print('labels',labels)
|
| 23 |
# Predict entities using GLiNER
|
| 24 |
entities = self.model.predict_entities(inputs, labels)
|