This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from langchain import PromptTemplate, LLMChain | |
from langchain.document_loaders import UnstructuredHTMLLoader | |
from langchain.embeddings import LlamaCppEmbeddings | |
from langchain.llms import LlamaCpp | |
from langchain.text_splitter import RecursiveCharacterTextSplitter | |
from langchain.vectorstores.faiss import FAISS | |
loader = UnstructuredHTMLLoader("langchain/docs/_build/html/index.html") | |
embedding = LlamaCppEmbeddings(model_path="path/models/ggml-model-q4_0.bin") | |
llm = LlamaCpp(model_path="path/models/ggml-model-q4_0.bin") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from io import StringIO | |
import sys | |
from typing import Dict, Optional | |
from langchain.agents import load_tools | |
from langchain.agents import initialize_agent | |
from langchain.agents.tools import Tool | |
from langchain.llms import OpenAI |