Find answers from the community

Updated 2 years ago

Api key

Plain Text
 index = GPTVectorStoreIndex.from_documents(documents, service_context=service_context) 

Is it possible to use this function without api key
L
P
8 comments
can you explain more how we define both of them in local ?
I think both those links cover it well. There's even two example notebooks for the huggingface llm there

We are so releasing a new tutorial notebook tomorrow, keep your eyes peeled 👀

Anything in particular that's confusing?
I am following the second link but the error show require openai key
Yea, you need to provide both an llm_predictor and an embed_model, otherwise the one you don't provide defaults to an openai model
If you only want to retrieve relevant nodes, and not send text to an LLM, set your embed model but also set your openai key to something random

Then you can do this
Plain Text
query_engine = index.as_query_engine(response_mode="no_text")
response = index.query(...)
print(response.source_nodes)


This will show the nodes that would have been sent to the llm, without sending them
Thanks you now I can run it however it have warning that
Plain Text
Setting `pad_token_id` to `eos_token_id`:50256 for open-end generation.
Yup, that's fine. That just means it's generating until it predicts a special token or it runs out of room (which is normal)
Add a reply
Sign up and join the conversation on Discord