diff --git a/backends/python/server/text_embeddings_server/models/__init__.py b/backends/python/server/text_embeddings_server/models/__init__.py index 72ec500d..a2258be0 100644 --- a/backends/python/server/text_embeddings_server/models/__init__.py +++ b/backends/python/server/text_embeddings_server/models/__init__.py @@ -65,7 +65,15 @@ def get_model(model_path: Path, dtype: Optional[str], pool: str): return DefaultModel( model_path, device, datatype, pool, trust_remote=TRUST_REMOTE_CODE ) - return FlashBert(model_path, device, datatype) + try: + return FlashBert(model_path, device, datatype) + except FileNotFoundError as e: + logger.info( + "Do not have safetensors file for this model, use default transformers model path instead" + ) + return DefaultModel( + model_path, device, datatype, pool, trust_remote=TRUST_REMOTE_CODE + ) if config.architectures[0].endswith("Classification"): return ClassificationModel( model_path, device, datatype, trust_remote=TRUST_REMOTE_CODE