Find answers from the community

Home
Members
Greg Tanaka
G
Greg Tanaka
Offline, last seen 2 months ago
Joined September 25, 2024
Does anyone know how to get the new OpenAI embedding model to work:
Plain Text
embed_model = OpenAIEmbedding(model="text-embedding-3-large", dimensions=3072)


---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[29], line 1
----> 1 embeddings = embed_model.get_text_embedding("Your text here")
2 print(embeddings)

File ~/anaconda3/envs/embeddings/lib/python3.11/site-packages/llama_index/core/embeddings/base.py:207, in BaseEmbedding.get_text_embedding(self, text)
196 """
197 Embed the input text.
198
(...)
202 predefined instructions can be found in embeddings/huggingface_utils.py.
203 """
204 with self.callback_manager.event(
205 CBEventType.EMBEDDING, payload={EventPayload.SERIALIZED: self.to_dict()}
206 ) as event:
--> 207 text_embedding = self._get_text_embedding(text)
209 event.on_end(
210 payload={
211 EventPayload.CHUNKS: [text],
212 EventPayload.EMBEDDINGS: [text_embedding],
213 }
214 )
216 return text_embedding
...
134 return (
--> 135 client.embeddings.create(input=[text], model=engine, **kwargs).data[0].embedding
136 )

TypeError: Embeddings.create() got an unexpected keyword argument 'dimensions'


Does the vector store automatically use the larger number (3k vs. 1.5k) of dimensions?
4 comments
G
L
For graph queries, how do we control what text (e.g. "grazing animals") is used for finding the right vectors vs. instructions for GPT (e.g. "write a paragraph")?
2 comments
L
How do I see what chunks of text were created and the associate vectors?
5 comments
L
G
j
Anyone know what is causing this ---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[5], line 1
----> 1 from llama_index import download_loader, GPTSimpleVectorIndex
2 from pathlib import Path

File ~/.local/lib/python3.9/site-packages/llama_index/init.py:18
15 from llama_index.embeddings.openai import OpenAIEmbedding
17 # structured
---> 18 from llama_index.indices.common.struct_store.base import SQLDocumentContextBuilder
19 from llama_index.indices.composability.graph import ComposableGraph
20 from llama_index.indices.empty import GPTEmptyIndex

File ~/.local/lib/python3.9/site-packages/llama_index/indices/common/struct_store/base.py:9
7 from llama_index.data_structs.node_v2 import Node
8 from llama_index.data_structs.table import StructDatapoint
----> 9 from llama_index.indices.response.builder import ResponseBuilder, TextChunk
10 from llama_index.indices.service_context import ServiceContext
11 from llama_index.langchain_helpers.chain_wrapper import LLMPredictor

File ~/.local/lib/python3.9/site-packages/llama_index/indices/response/builder.py:18
16 from llama_index.data_structs.node_v2 import Node, NodeWithScore
17 from llama_index.docstore_v2 import DocumentStore
---> 18 from llama_index.indices.common.tree.base import GPTTreeIndexBuilder
19 from llama_index.indices.service_context import ServiceContext
...
33 )
34 from llama_index.indices.service_context import ServiceContext
35 from llama_index.optimization.optimizer import BaseTokenUsageOptimizer

ImportError: cannot import name 'RESPONSE_TEXT_TYPE' from partially initialized module 'llama_index.indices.response.builder' (most likely due to a circular import) (/home/gregtanaka/.local/lib/python3.9/site-packages/llama_index/indices/response/builder.py)
2 comments
G
j
It looks like GPTSimpleVectorIndex no longer has set_text so the code doesn't work...
14 comments
G
L
T
Has anyone been able to get pickle to work with Llama Index? Seems like everyone gets a 'cannot pickle 'builtins.CoreBPE' object' error
9 comments
G
L
r
@Logan M any idea how to do this? I tried several method but none worked.
16 comments
L
G
Has anyone figured out how to do custom prompts with ComposableGraph.query()?
13 comments
L
G