sitammeur commited on
Commit
258b0b5
·
verified ·
1 Parent(s): 5d18bb2

Update src/app/model.py

Browse files
Files changed (1) hide show
  1. src/app/model.py +4 -4
src/app/model.py CHANGED
@@ -18,7 +18,7 @@ load_dotenv()
18
  access_token = os.environ.get("ACCESS_TOKEN")
19
 
20
 
21
- def load_model_and_tokenizer(model_name: str, device: str) -> Any:
22
  """
23
  Load the model, tokenizer and processor.
24
 
@@ -49,13 +49,13 @@ def load_model_and_tokenizer(model_name: str, device: str) -> Any:
49
  )
50
  model.eval()
51
 
52
- # Log the successful loading of the model and tokenizer
53
- logging.info("Model and tokenizer loaded successfully.")
54
 
55
  # Return the model, tokenizer and processor
56
  return model, tokenizer, processor
57
 
58
- # Handle exceptions that may occur during model and tokenizer loading
59
  except Exception as e:
60
  # Custom exception handling
61
  raise CustomExceptionHandling(e, sys) from e
 
18
  access_token = os.environ.get("ACCESS_TOKEN")
19
 
20
 
21
+ def load_model_tokenizer_and_processor(model_name: str, device: str) -> Any:
22
  """
23
  Load the model, tokenizer and processor.
24
 
 
49
  )
50
  model.eval()
51
 
52
+ # Log the successful loading of the model, tokenizer and processor
53
+ logging.info("Model, tokenizer and processor loaded successfully.")
54
 
55
  # Return the model, tokenizer and processor
56
  return model, tokenizer, processor
57
 
58
+ # Handle exceptions that may occur during model, tokenizer and processor loading
59
  except Exception as e:
60
  # Custom exception handling
61
  raise CustomExceptionHandling(e, sys) from e