id stringlengths 14 16 | text stringlengths 45 2.05k | source stringlengths 53 111 |
|---|---|---|
5211de1b2b1f-5 | The name of the endpoint from the deployed Sagemaker model.
Must be unique within an AWS Region.
field model_kwargs: Optional[Dict] = None#
Key word arguments to pass to the model.
field region_name: str = ''#
The aws region where the Sagemaker model is deployed, eg. us-west-2.
embed_documents(texts: List[str], chunk_s... | https://langchain.readthedocs.io/en/latest/reference/modules/embeddings.html |
5211de1b2b1f-6 | tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
return pipeline("feature-extraction", model=model, tokenizer=tokenizer)
embeddings = SelfHostedEmbeddings(
model_load_fn=get_pipeline,
hardware=gpu
model_reqs=["./", "torch", "transformers"],
)... | https://langchain.readthedocs.io/en/latest/reference/modules/embeddings.html |
5211de1b2b1f-7 | Parameters
text – The text to embed.
Returns
Embeddings for the text.
pydantic model langchain.embeddings.SelfHostedHuggingFaceEmbeddings[source]#
Runs sentence_transformers embedding models on self-hosted remote hardware.
Supported hardware includes auto-launched instances on AWS, GCP, Azure,
and Lambda, as well as se... | https://langchain.readthedocs.io/en/latest/reference/modules/embeddings.html |
5211de1b2b1f-8 | Runs InstructorEmbedding embedding models on self-hosted remote hardware.
Supported hardware includes auto-launched instances on AWS, GCP, Azure,
and Lambda, as well as servers specified
by IP address and SSH credentials (such as on-prem, or another
cloud like Paperspace, Coreweave, etc.).
To use, you should have the r... | https://langchain.readthedocs.io/en/latest/reference/modules/embeddings.html |
5211de1b2b1f-9 | pydantic model langchain.embeddings.TensorflowHubEmbeddings[source]#
Wrapper around tensorflow_hub embedding models.
To use, you should have the tensorflow_text python package installed.
Example
from langchain.embeddings import TensorflowHubEmbeddings
url = "https://tfhub.dev/google/universal-sentence-encoder-multiling... | https://langchain.readthedocs.io/en/latest/reference/modules/embeddings.html |
f7dce668e0ea-0 | .md
.pdf
Quickstart Guide
Contents
Installation
Environment Setup
Building a Language Model Application
Quickstart Guide#
This tutorial gives you a quick walkthrough about building an end-to-end language model application with LangChain.
Installation#
To get started, install LangChain with the following command:
pip ... | https://langchain.readthedocs.io/en/latest/getting_started/getting_started.html |
f7dce668e0ea-1 | We can now call it on some input!
text = "What would be a good company name for a company that makes colorful socks?"
print(llm(text))
Feetful of Fun
For more details on how to use LLMs within LangChain, see the LLM getting started guide.
Prompt Templates: Manage prompts for LLMs
Calling an LLM is a great first step, b... | https://langchain.readthedocs.io/en/latest/getting_started/getting_started.html |
f7dce668e0ea-2 | The most core type of chain is an LLMChain, which consists of a PromptTemplate and an LLM.
Extending the previous example, we can construct an LLMChain which takes user input, formats it with a PromptTemplate, and then passes the formatted response to an LLM.
from langchain.prompts import PromptTemplate
from langchain.... | https://langchain.readthedocs.io/en/latest/getting_started/getting_started.html |
f7dce668e0ea-3 | In order to load agents, you should understand the following concepts:
Tool: A function that performs a specific duty. This can be things like: Google Search, Database lookup, Python REPL, other chains. The interface for a tool is currently a function that is expected to have a string as an input, with a string as an o... | https://langchain.readthedocs.io/en/latest/getting_started/getting_started.html |
f7dce668e0ea-4 | # Now let's test it out!
agent.run("Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?")
Entering new AgentExecutor chain...
I need to find out who Olivia Wilde's boyfriend is and then calculate his age raised to the 0.23 power.
Action: Search
Action Input: "Olivia Wilde boyfriend"
Obse... | https://langchain.readthedocs.io/en/latest/getting_started/getting_started.html |
f7dce668e0ea-5 | Memory: Add state to chains and agents
So far, all the chains and agents we’ve gone through have been stateless. But often, you may want a chain or agent to have some concept of “memory” so that it may remember information about its previous interactions. The clearest and simple example of this is when designing a chat... | https://langchain.readthedocs.io/en/latest/getting_started/getting_started.html |
f7dce668e0ea-6 | > Entering new chain...
Prompt after formatting:
The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.
Current conversation:
Human: Hi there!
A... | https://langchain.readthedocs.io/en/latest/getting_started/getting_started.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.