[*]Conversational retrieval using ConversationalRetrievalChain
[*]FAQ-style interactions
[*]Low-latency, local inference
< /ul>
Я рассматриваю такие модели, как Mistral или Phi-2, но я не уверен, как загружать и интегрировать их с помощью Langchain, используя локальный сервер локальных локальных локаций, такого как Ollama или Ctransformers. < /p>
Каков правильный подход к: < /p>
- llama-cpp, ctransformers,
or ollama) - Use it with ConversationalRetrievalChain
- Replace ChatGoogleGenerativeAI with a compatible LLM wrapper
from langchain.chains import ConversationalRetrievalChain
from langchain.memory import ConversationBufferWindowMemory
from langchain.prompts import PromptTemplate
from langchain_community.document_loaders import TextLoader
from langchain.indexes import VectorstoreIndexCreator
from langchain_google_genai import ChatGoogleGenerativeAI
# Prompt and LLM
custom_prompt = PromptTemplate.from_template("""
You are a helpful hotel assistant...
Context: {context}
Question: {question}
""")
llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash",
google_api_key="...")
# How can I replace `llm` above with a local SLM loaded via
Ollama or
another LangChain-compatible interface?
Подробнее здесь: https://stackoverflow.com/questions/796 ... nversation