Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Upload 2 files
Browse files- rag_chain/chain.py +1 -0
- rag_chain/retrievers_setup.py +0 -1
rag_chain/chain.py
CHANGED
@@ -66,6 +66,7 @@ def format_tall_tree_docs(docs: list[Document]) -> str:
|
|
66 |
)
|
67 |
|
68 |
|
|
|
69 |
def create_langsmith_client():
|
70 |
"""Create a Langsmith client."""
|
71 |
os.environ["LANGCHAIN_TRACING_V2"] = "true"
|
|
|
66 |
)
|
67 |
|
68 |
|
69 |
+
@cache
|
70 |
def create_langsmith_client():
|
71 |
"""Create a Langsmith client."""
|
72 |
os.environ["LANGCHAIN_TRACING_V2"] = "true"
|
rag_chain/retrievers_setup.py
CHANGED
@@ -110,7 +110,6 @@ class SparseRetrieverClient:
|
|
110 |
model = AutoModelForMaskedLM.from_pretrained(self.model_id)
|
111 |
return tokenizer, model
|
112 |
|
113 |
-
@cache
|
114 |
def sparse_encoder(self, text: str) -> tuple[list[int], list[float]]:
|
115 |
"""This function encodes the input text into a sparse vector. The encoder is required for the QdrantSparseVectorRetriever.
|
116 |
Adapted from the Qdrant documentation: Computing the Sparse Vector code.
|
|
|
110 |
model = AutoModelForMaskedLM.from_pretrained(self.model_id)
|
111 |
return tokenizer, model
|
112 |
|
|
|
113 |
def sparse_encoder(self, text: str) -> tuple[list[int], list[float]]:
|
114 |
"""This function encodes the input text into a sparse vector. The encoder is required for the QdrantSparseVectorRetriever.
|
115 |
Adapted from the Qdrant documentation: Computing the Sparse Vector code.
|