Text Classification
Transformers
Safetensors
English
tcred_sl
feature-extraction
rag-evaluation
retrieval-augmented-generation
temporal-rag
graph-rag
temporal-qa
temporal-knowledge-graph
evaluation-metric
factual-consistency
answer-correctness
answer-equivalence
evidence-grounding
evidence-attribution
citation-evaluation
hallucination-detection
answerability
information-retrieval
minilm
research
custom_code
Instructions to use Quicksort-fr/T-CRED-SL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Quicksort-fr/T-CRED-SL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Quicksort-fr/T-CRED-SL", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Quicksort-fr/T-CRED-SL", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download example.py from Quicksort-fr/T-CRED-SL: direct link, hf CLI and curl.
- Browser
- Download file 1.4 kB
-
https://huggingface.co/Quicksort-fr/T-CRED-SL/resolve/main/example.py
- Command line
-
hf download hf://Quicksort-fr/T-CRED-SL/example.py
-
curl -L -o example.py https://huggingface.co/Quicksort-fr/T-CRED-SL/resolve/main/example.py
1.4 kB
| """Minimal end-to-end example for Quicksort-fr/T-CRED-SL.""" | |
| from __future__ import annotations | |
| import json | |
| import torch | |
| from transformers import AutoModel, AutoTokenizer | |
| MODEL_ID = "Quicksort-fr/T-CRED-SL" | |
| def main() -> None: | |
| tokenizer = AutoTokenizer.from_pretrained(MODEL_ID) | |
| model = AutoModel.from_pretrained(MODEL_ID, trust_remote_code=True) | |
| model.to("cuda" if torch.cuda.is_available() else "cpu") | |
| records = [ | |
| { | |
| "input_id": "answer-example", | |
| "task": "answer", | |
| "question": "Who led the organization in 2020?", | |
| "query_time_or_interval": "2020", | |
| "temporal_operator": "during", | |
| "reference_answers": ["Alex Morgan"], | |
| "candidate_or_claim": "Alex Morgan", | |
| }, | |
| { | |
| "input_id": "support-example", | |
| "task": "support", | |
| "question": "Who led the organization in 2020?", | |
| "candidate_or_claim": "Alex Morgan led the organization in 2020.", | |
| "evidence_passages": [ | |
| { | |
| "evidence_id": "e1", | |
| "text": "Alex Morgan served as the organization's director from 2019 to 2021.", | |
| } | |
| ], | |
| }, | |
| ] | |
| predictions = model.predict(tokenizer, records, batch_size=8) | |
| print(json.dumps(predictions, indent=2)) | |
| if __name__ == "__main__": | |
| main() | |