AndresR2909
commited on
Commit
•
4d8a834
1
Parent(s):
6fe5482
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 |
|