Instructions to use Utk113Raj/gliner_large_deployable with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER
How to use Utk113Raj/gliner_large_deployable with GLiNER:
from gliner import GLiNER model = GLiNER.from_pretrained("Utk113Raj/gliner_large_deployable") 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
Download handler.py from Utk113Raj/gliner_large_deployable: direct link, hf CLI and curl.
- Browser
- Download file 606 Bytes
-
https://huggingface.co/Utk113Raj/gliner_large_deployable/resolve/main/handler.py
- Command line
-
hf download hf://Utk113Raj/gliner_large_deployable/handler.py
-
curl -L -o handler.py https://huggingface.co/Utk113Raj/gliner_large_deployable/resolve/main/handler.py
606 Bytes
| from gliner import GLiNER | |
| class EndpointHandler: | |
| def __init__(self, path=""): | |
| # Use the provided path for loading the model | |
| self.model = GLiNER.from_pretrained(path) | |
| def __call__(self, data): | |
| try: | |
| text = data.get("text", "") | |
| labels = data.get("labels", []) | |
| if not text or not labels: | |
| return {"error": "Please provide 'text' and 'labels'"} | |
| entities = self.model.predict(text, labels) | |
| return {"entities": entities} | |
| except Exception as e: | |
| return {"error": str(e)} |