Khriis commited on
Commit
d0a5cbd
verified
1 Parent(s): 6e81e10

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +10 -1
handler.py CHANGED
@@ -32,7 +32,16 @@ class EndpointHandler:
32
  try:
33
  # Load tokenizer and model explicitly to ensure correct loading
34
  tokenizer = AutoTokenizer.from_pretrained(model_path)
35
- model = AutoModelForQuestionAnswering.from_pretrained(model_path)
 
 
 
 
 
 
 
 
 
36
 
37
  # Initialize the pipeline
38
  # top_k=20 matches your previous 'n_best_size=20' logic
 
32
  try:
33
  # Load tokenizer and model explicitly to ensure correct loading
34
  tokenizer = AutoTokenizer.from_pretrained(model_path)
35
+ model, loading_info = AutoModelForQuestionAnswering.from_pretrained(
36
+ model_path,
37
+ output_loading_info=True
38
+ )
39
+
40
+ logger.warning("RECCON load info - missing_keys: %s", loading_info.get("missing_keys"))
41
+ logger.warning("RECCON load info - unexpected_keys: %s", loading_info.get("unexpected_keys"))
42
+ logger.warning("RECCON load info - error_msgs: %s", loading_info.get("error_msgs"))
43
+ logger.warning("Loaded model class: %s", model.__class__.__name__)
44
+ logger.warning("Loaded model name_or_path: %s", getattr(model.config, "_name_or_path", None))
45
 
46
  # Initialize the pipeline
47
  # top_k=20 matches your previous 'n_best_size=20' logic