Instructions to use laol777/ttttt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use laol777/ttttt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="laol777/ttttt")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("laol777/ttttt") model = AutoModelForSequenceClassification.from_pretrained("laol777/ttttt", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download handler.py from laol777/ttttt: direct link, hf CLI and curl.
- Browser
- Download file 589 Bytes
-
https://huggingface.co/laol777/ttttt/resolve/main/handler.py
- Command line
-
hf download hf://laol777/ttttt/handler.py
-
curl -L -o handler.py https://huggingface.co/laol777/ttttt/resolve/main/handler.py
589 Bytes
| from typing import Dict, List, Any | |
| from transformers import pipeline | |
| import holidays | |
| import sys | |
| import os | |
| class EndpointHandler: | |
| def __init__(self, path=""): | |
| self.pipeline = pipeline("text-classification", model=path) | |
| self.holidays = holidays.US() | |
| def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]: | |
| """ | |
| data args: | |
| inputs (:obj: `str`) | |
| date (:obj: `str`) | |
| Return: | |
| A :obj:`list` | `dict`: will be serialized and returned | |
| """ | |
| return [{'data': '42'}, {'data2': '43'}] | |