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 |
|