Find answers from the community

Updated 4 months ago

LlamaIndex replace LLM Provider

At a glance
Hello, I am trying to run Fast API Python backend for fullstack application ( from create-llama command). But with Replaced default LLM Provider. I am trying to replace OpenAI llm with PaLM llm and OpenAI embeddings with palm embeddings and I got some issue. Listing is here: https://gist.github.com/OTR/2eeca8d7fa8d5087397a3f9944b6a0fb
L
A
24 comments
seems like a bug with palm embeddings, although I could have sworn we fixed that
what version of llama-index do you have?
I just checked out it is quite old version, 0.8.69.post2 . It was boundled with npm package from here: https://www.npmjs.com/package/create-llama
Also, I wrote there lines after ServiceContextIstantiating and previous error massage has gone, but another one is pulled out
After that little patch, it does successfully create an index from documents, but seems like fails to load it again: see error listing
Seems like the vector store didn't save correctly, for whatever reason. Never seen that before lol
maybe check the default__vector_store.json file, it should be a JSON with this structure
Attachment
image.png
Attachment
image.png
ah not fine actually
the embedding dict should be Dict[str, List[float]]
Seems like palm embeddings might still be bugged, they are returning a single float...
Are you able to reproduce the bug or I need to provide additional information?
I don't have access to palm to test, but I would appreciate a PR if you have time!

Basically need to test that each of these methods are returning the proper types...
https://github.com/run-llama/llama_index/blob/41710721d23a35093963573128b18ccf20c5d757/llama_index/embeddings/google_palm.py#L51
I can share my API KEY
yea that works too, if you don't mind
got it πŸ™‚
(deleted your message as well lol)
weird, I am unable to get it to work

Plain Text
>>> from llama_index.embeddings import GooglePaLMEmbedding
>>> embed_model = GooglePaLMEmbedding(api_key="....", model_name="models/embedding-gecko-001")
>>> out = embed_model.get_text_embedding("test")


Just returns a 503 error. Some locally, locally on a VPN, and on google colab πŸ€”
Try this KEY with text-bison-001 (PaLM 2). It should fit all of them,
Plain Text
llm=PaLM(
        api_key=os.getenv("GOOGLE_AI_API_KEY"),
        model_name="models/text-bison-001",
    )
similar error there πŸ˜… I know google-palm isn't available in Canada, but usually using a VPN or google colab gets around that... but not anymore it seems? :PSadge:
I really recommend you test and make a PR yourself, it's really easy πŸ™‚
Add a reply
Sign up and join the conversation on Discord