Open yogeshhk opened 9 months ago
Instead of from langchain.llms import HuggingFaceHub
you may need from langchain_community.llms import HuggingFaceEndpoint
Instead of from langchain.chains import LLMChain
you may need LCEL way
# Old Code (using LLMChain)
from langchain.chains import LLMChain
from langchain_openai import OpenAI
prompt = "Write a poem about a cat"
llm_chain = LLMChain(prompt=prompt, llm=OpenAI())
result = llm_chain.invoke()
# New Code (using RunnableSequence)
from langchain_openai import OpenAI
prompt = "Write a poem about a cat"
llm = OpenAI()
result = prompt | llm
Employ a bit advance techniques for segmentation and reranking in 'ask_bharat' bot.
Reference can be https://lightning.ai/lightning-ai/studios/document-search-and-retrieval-using-rag?view=public§ion=recent