Text Classification
Transformers
TensorBoard
Safetensors
distilbert
Generated from Trainer
text-embeddings-inference
Instructions to use AndresR2909/finetuning_bert_text_classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AndresR2909/finetuning_bert_text_classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AndresR2909/finetuning_bert_text_classification")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("AndresR2909/finetuning_bert_text_classification") model = AutoModelForSequenceClassification.from_pretrained("AndresR2909/finetuning_bert_text_classification", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update handler.py
Browse files- handler.py +7 -1
handler.py
CHANGED
|
@@ -1,8 +1,14 @@
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
class EndpointHandler():
|
| 5 |
-
def __init__(self, path=""):
|
|
|
|
| 6 |
self.pipeline = pipeline(model=path, truncation=True,)
|
| 7 |
|
| 8 |
|
|
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
from transformers import pipeline
|
| 3 |
+
import logging
|
| 4 |
+
|
| 5 |
+
# Configuraci贸n b谩sica del logging
|
| 6 |
+
logging.basicConfig(level=logging.INFO)
|
| 7 |
+
logger = logging.getLogger(__name__)
|
| 8 |
|
| 9 |
class EndpointHandler():
|
| 10 |
+
def __init__(self, path="AndresR2909/finetuning-bert-text-classification"):
|
| 11 |
+
logger.info(f"Modelo cargado desde el path: {path}")
|
| 12 |
self.pipeline = pipeline(model=path, truncation=True,)
|
| 13 |
|
| 14 |
|