Update app.py
Browse files
app.py
CHANGED
@@ -66,12 +66,11 @@ llm = GroqLLM(api_key=groq_api_key, model_name="deepseek-r1-distill-llama-70b")
|
|
66 |
from langchain_core.retrievers import BaseRetriever
|
67 |
from langchain_core.documents import Document
|
68 |
from typing import List
|
|
|
69 |
|
70 |
class SimpleRetriever(BaseRetriever):
|
71 |
-
|
72 |
-
|
73 |
-
self.documents = documents
|
74 |
-
self.embeddings = embeddings
|
75 |
|
76 |
def _get_relevant_documents(self, query: str) -> List[Document]:
|
77 |
inputs = tokenizer(query, return_tensors="pt", padding=True, truncation=True)
|
|
|
66 |
from langchain_core.retrievers import BaseRetriever
|
67 |
from langchain_core.documents import Document
|
68 |
from typing import List
|
69 |
+
from pydantic import Field
|
70 |
|
71 |
class SimpleRetriever(BaseRetriever):
|
72 |
+
documents: List[Document] = Field(...)
|
73 |
+
embeddings: List = Field(...)
|
|
|
|
|
74 |
|
75 |
def _get_relevant_documents(self, query: str) -> List[Document]:
|
76 |
inputs = tokenizer(query, return_tensors="pt", padding=True, truncation=True)
|