Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
OurBuilding Ambient Agents with LangGraph course is now available on LangChain Academy!
Open In ColabOpen on GitHub

Instruct Embeddings on Hugging Face

Hugging Face sentence-transformers is a Python framework for state-of-the-art sentence, text and image embeddings.One of the instruct embedding models is used in theHuggingFaceInstructEmbeddings class.

from langchain_community.embeddingsimport HuggingFaceInstructEmbeddings
embeddings= HuggingFaceInstructEmbeddings(
query_instruction="Represent the query for retrieval: "
)
load INSTRUCTOR_Transformer
max_seq_length 512
text="This is a test document."
query_result= embeddings.embed_query(text)

Related


[8]ページ先頭

©2009-2025 Movatter.jp