Spaces:
Sleeping
Sleeping
vhr1007
commited on
Commit
·
b8ef5f6
1
Parent(s):
b052cfd
debug
Browse files
app.py
CHANGED
@@ -54,6 +54,9 @@ try:
|
|
54 |
model = AutoModel.from_pretrained('nomic-ai/nomic-embed-text-v1.5', trust_remote_code=True)
|
55 |
|
56 |
logging.info("Successfully loaded the model and tokenizer with transformers.")
|
|
|
|
|
|
|
57 |
except Exception as e:
|
58 |
logging.error(f"Failed to load the model: {e}")
|
59 |
raise HTTPException(status_code=500, detail="Failed to load the custom model.")
|
|
|
54 |
model = AutoModel.from_pretrained('nomic-ai/nomic-embed-text-v1.5', trust_remote_code=True)
|
55 |
|
56 |
logging.info("Successfully loaded the model and tokenizer with transformers.")
|
57 |
+
# Initialize the Qdrant searcher after the model is successfully loaded
|
58 |
+
global searcher # Ensure searcher is accessible globally if needed
|
59 |
+
searcher = QdrantSearcher(encoder=model, qdrant_url=qdrant_url, access_token=access_token)
|
60 |
except Exception as e:
|
61 |
logging.error(f"Failed to load the model: {e}")
|
62 |
raise HTTPException(status_code=500, detail="Failed to load the custom model.")
|