Run this model with HF Jobs
Run Mbiot/gliner-custom on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Mbiot/gliner-custom. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Mbiot/gliner-custom on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
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") 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
Manu Biot commited on
Commit ·
b121d58
1
Parent(s): 6f0d3f3
Add requirements.txt for endpoint dependencies
Browse files1234567891011121314from gliner import GLiNERfrom typing import Dictclass EndpointHandler:def __init__(self, path=""):self.model = GLiNER.from_pretrained(path)def __call__(self, data: Dict[str, str]) -> Dict:text = data.get("text", "")labels = data.get("labels", [])if not text or not labels:return {"error": "Missing 'text' or 'labels'"}entities = self.model.predict_entities(text, labels)return {"entities": entities}123456789101112131415from gliner import GLiNERfrom typing import Dict, List, Anyclass EndpointHandler():def __init__(self, path=""):self.model = GLiNER.from_pretrained("Mbiot/gliner-custom")def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:# get inputsinputs = data.pop("inputs", data)labels = data.pop("labels", None)prediction = self.model.predict_entities(inputs, labels)return prediction
handler.py+12-11