Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,6 +32,7 @@ from llama_index.core.node_parser import SentenceSplitter
|
|
| 32 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, BitsAndBytesConfig
|
| 33 |
from huggingface_hub import login
|
| 34 |
import qdrant_client
|
|
|
|
| 35 |
|
| 36 |
# Configure logging
|
| 37 |
logging.basicConfig(
|
|
@@ -165,9 +166,9 @@ reranker = SentenceTransformerRerank(
|
|
| 165 |
device="cuda" if torch.cuda.is_available() else "cpu"
|
| 166 |
)
|
| 167 |
|
| 168 |
-
query_engine =
|
| 169 |
retriever=hybrid_retriever,
|
| 170 |
-
node_postprocessors=[reranker]
|
| 171 |
)
|
| 172 |
|
| 173 |
# --- CELL 6: Load & Quantize LLaMA Model ---
|
|
|
|
| 32 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, BitsAndBytesConfig
|
| 33 |
from huggingface_hub import login
|
| 34 |
import qdrant_client
|
| 35 |
+
from llama_index.core.query_engine import RetrieverQueryEngine
|
| 36 |
|
| 37 |
# Configure logging
|
| 38 |
logging.basicConfig(
|
|
|
|
| 166 |
device="cuda" if torch.cuda.is_available() else "cpu"
|
| 167 |
)
|
| 168 |
|
| 169 |
+
query_engine = RetrieverQueryEngine(
|
| 170 |
retriever=hybrid_retriever,
|
| 171 |
+
node_postprocessors=[reranker]
|
| 172 |
)
|
| 173 |
|
| 174 |
# --- CELL 6: Load & Quantize LLaMA Model ---
|