Instructions to use Utk113Raj/Gliner_113_Entity_Large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER
How to use Utk113Raj/Gliner_113_Entity_Large with GLiNER:
from gliner import GLiNER model = GLiNER.from_pretrained("Utk113Raj/Gliner_113_Entity_Large") text = "Cristiano Ronaldo dos Santos Aveiro was born on 5 February 1985 in Funchal, Madeira, Portugal." labels = ["person", "date", "location"] entities = model.predict_entities(text, labels) for entity in entities: print(entity["text"], "=>", entity["label"]) - Notebooks
- Google Colab
- Kaggle
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
|