Instructions to use Mbiot/gliner-custom with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER
How to use Mbiot/gliner-custom with GLiNER:
from gliner import GLiNER model = GLiNER.from_pretrained("Mbiot/gliner-custom") - Notebooks
- Google Colab
- Kaggle
| from gliner import GLiNER | |
| from typing import Dict, List, Any | |
| class EndpointHandler(): | |
| def __init__(self, path=""): | |
| self.model = GLiNER.from_pretrained(path) | |
| def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]: | |
| # get inputs | |
| inputs = data.pop("inputs", data) | |
| labels = data.pop("labels", None) | |
| prediction = self.model.predict_entities(inputs, labels) | |
| return prediction |