Add traceback to debug log on fallback

This commit is contained in:
somebody
2023-05-11 17:10:19 -05:00
parent 6838563ea9
commit c16336f646

View File

@@ -332,10 +332,13 @@ class HFTorchInferenceModel(HFInferenceModel):
raise
logger.warning(f"Fell back to GPT2LMHeadModel due to {e}")
logger.debug(traceback.format_exc())
try:
return GPT2LMHeadModel.from_pretrained(location, **tf_kwargs)
except Exception as e:
logger.warning(f"Fell back to GPTNeoForCausalLM due to {e}")
logger.debug(traceback.format_exc())
return GPTNeoForCausalLM.from_pretrained(location, **tf_kwargs)
def get_hidden_size(self) -> int: