Files
langchain/docs/modules/models/text_embedding/examples/tensorflowhub.ipynb
T
Leonid Ganeline 92a5f00ffb docs: ecosystem/integrations update 5 (#5752)
- added missed integration to `docs/ecosystem/integrations/`
- updated notebooks to consistent format: changed titles, file names;
added descriptions

#### Who can review?
 @hwchase17 
 @dev2049
2023-06-05 16:08:55 -07:00

3.0 KiB

Tensorflow Hub

TensorFlow Hub is a repository of trained machine learning models ready for fine-tuning and deployable anywhere.

TensorFlow Hub lets you search and discover hundreds of trained, ready-to-deploy machine learning models in one place.

In [1]:
from langchain.embeddings import TensorflowHubEmbeddings
In [5]:
embeddings = TensorflowHubEmbeddings()
2023-01-30 23:53:01.652176: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-01-30 23:53:34.362802: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
In [6]:
text = "This is a test document."
In [7]:
query_result = embeddings.embed_query(text)
In [6]:
doc_results = embeddings.embed_documents(["foo"])
In [ ]:
doc_results
In [ ]: