File size: 1,059 Bytes
f0fc5f8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# LANGCHAIN IMPORTS
from langchain import PromptTemplate, LLMChain
from langchain.embeddings import HuggingFaceEmbeddings
from langchain.chains import RetrievalQAWithSourcesChain
from langchain.chains.qa_with_sources import load_qa_with_sources_chain
# CLIMATEQA
from climateqa.retriever import ClimateQARetriever
from climateqa.vectorstore import get_pinecone_vectorstore
from climateqa.chains import load_climateqa_chain
class ClimateQA:
def __init__(self,hf_embedding_model = "sentence-transformers/multi-qa-mpnet-base-dot-v1",
show_progress_bar = False,batch_size = 1,max_tokens = 1024,**kwargs):
self.llm = self.get_llm(max_tokens = max_tokens,**kwargs)
self.embeddings_function = HuggingFaceEmbeddings(
model_name=hf_embedding_model,
encode_kwargs={"show_progress_bar":show_progress_bar,"batch_size":batch_size}
)
def get_vectorstore(self):
pass
def reformulate(self):
pass
def retrieve(self):
pass
def ask(self):
pass |