AndresR2909 commited on
Commit
a7f3b7d
·
verified ·
1 Parent(s): 4d8a834

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +6 -1
handler.py CHANGED
@@ -9,7 +9,12 @@ logger = logging.getLogger(__name__)
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
 
15
  def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
 
9
  class EndpointHandler():
10
  def __init__(self, path="AndresR2909/finetuning-bert-text-classification"):
11
  logger.info(f"Modelo cargado desde el path: {path}")
12
+ # Cargar el pipeline con el modelo especificado
13
+ try:
14
+ self.pipeline = pipeline(model=path, truncation=True)
15
+ except Exception as e:
16
+ logger.exception(f"Error cargando el modelo desde el path {path}: {e}")
17
+ raise
18
 
19
 
20
  def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]: