mirror of
https://github.com/Mintplex-Labs/langchain-python.git
synced 2026-07-19 13:26:32 -04:00
fe6695b9e7
https://github.com/hwchase17/langchain/issues/354 Add support for running your own HF pipeline locally. This would allow you to get a lot more dynamic with what HF features and models you support since you wouldn't be beholden to what is hosted in HF hub. You could also do stuff with HF Optimum to quantize your models and stuff to get pretty fast inference even running on a laptop.
67 lines
1.6 KiB
Python
67 lines
1.6 KiB
Python
"""Main entrypoint into package."""
|
|
|
|
from typing import Optional
|
|
|
|
from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain
|
|
from langchain.cache import BaseCache
|
|
from langchain.chains import (
|
|
ConversationChain,
|
|
LLMBashChain,
|
|
LLMChain,
|
|
LLMCheckerChain,
|
|
LLMMathChain,
|
|
PALChain,
|
|
QAWithSourcesChain,
|
|
SQLDatabaseChain,
|
|
VectorDBQA,
|
|
VectorDBQAWithSourcesChain,
|
|
)
|
|
from langchain.docstore import InMemoryDocstore, Wikipedia
|
|
from langchain.llms import Cohere, HuggingFaceHub, OpenAI
|
|
from langchain.llms.huggingface_pipeline import HuggingFacePipeline
|
|
from langchain.logger import BaseLogger, StdOutLogger
|
|
from langchain.prompts import (
|
|
BasePromptTemplate,
|
|
FewShotPromptTemplate,
|
|
Prompt,
|
|
PromptTemplate,
|
|
)
|
|
from langchain.serpapi import SerpAPIChain, SerpAPIWrapper
|
|
from langchain.sql_database import SQLDatabase
|
|
from langchain.vectorstores import FAISS, ElasticVectorSearch
|
|
|
|
logger: BaseLogger = StdOutLogger()
|
|
verbose: bool = False
|
|
llm_cache: Optional[BaseCache] = None
|
|
|
|
__all__ = [
|
|
"LLMChain",
|
|
"LLMBashChain",
|
|
"LLMCheckerChain",
|
|
"LLMMathChain",
|
|
"SelfAskWithSearchChain",
|
|
"SerpAPIWrapper",
|
|
"SerpAPIChain",
|
|
"Cohere",
|
|
"OpenAI",
|
|
"BasePromptTemplate",
|
|
"Prompt",
|
|
"FewShotPromptTemplate",
|
|
"PromptTemplate",
|
|
"ReActChain",
|
|
"Wikipedia",
|
|
"HuggingFaceHub",
|
|
"HuggingFacePipeline",
|
|
"SQLDatabase",
|
|
"SQLDatabaseChain",
|
|
"FAISS",
|
|
"MRKLChain",
|
|
"VectorDBQA",
|
|
"ElasticVectorSearch",
|
|
"InMemoryDocstore",
|
|
"ConversationChain",
|
|
"VectorDBQAWithSourcesChain",
|
|
"QAWithSourcesChain",
|
|
"PALChain",
|
|
]
|