AndresR2909 commited on
Commit
133bed4
·
verified ·
1 Parent(s): a7f3b7d

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -2
handler.py CHANGED
@@ -7,14 +7,15 @@ 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
  # 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]]:
 
7
  logger = logging.getLogger(__name__)
8
 
9
  class EndpointHandler():
10
+ def __init__(self, path=""):
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
+ path = "AndresR2909/finetuning-bert-text-classification"
18
+ self.pipeline = pipeline(model=path, truncation=True)
19
 
20
 
21
  def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]: