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
File size: 589 Bytes
27756d5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 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'}]
|