The post discusses an error encountered when trying to use the T5 model with the AutoModelForCausalLM class. Community members suggest that T5 is an encoder-decoder model, rather than a decoder model, and that the logic in llama-index is built around decoder models. They recommend implementing a custom LLM class from scratch if using T5.
The comments discuss trying to use the Mistral model instead, but some community members encountered issues with it as well. They provide a Colab notebook as a demo setup for Mistral, but one community member still faced problems. The discussion also covers issues with OpenAI API keys, using local embedding models, and the need to update the transformers package.
The community members discuss the memory requirements for running these models, with one suggesting that using an offloader would be too slow. They also ask about which EC2 instance and how much RAM would be good for running these models.
There is no explicitly marked answer in the provided information.
In addition, since T5 predicts all output tokens in one step (rather than one at at time), configure max_new_tokens on the LLM Metadata to be zero, otherwise llama-index will "leave room" in the input for the LLM to predict tokens (which is only needed for decoder models)
it does there are some display issue and one cell does not work, unfortunately i am hitting same issue with raw_nodes_2021 = node_parser.get_nodes_from_documents(documents, service_context=service_context) pickle.dump(raw_nodes_2021, open("2021_nodes.pkl", "wb"))
ValueError: No API key found for OpenAI. Please set either the OPENAI_API_KEY environment variable or openai.api_key prior to initialization. API keys can be found or created at https://platform.openai.com/account/api-keys
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/llama_index/embeddings/utils.py in resolve_embed_model(embed_model) 48 validate_openai_api_key(embed_model.api_key) 49 except ValueError as e: ---> 50 raise ValueError( 51 "\n**\n" 52 "Could not load OpenAI embedding model. "
ValueError: ** Could not load OpenAI embedding model. If you intended to use OpenAI, please check your OPENAI_API_KEY. Original error: No API key found for OpenAI. Please set either the OPENAI_API_KEY environment variable or openai.api_key prior to initialization. API keys can be found or created at https://platform.openai.com/account/api-keys
ValueError: The current device_map had weights offloaded to the disk. Please provide an offload_folder for them. Alternatively, make sure you have safetensors installed if the model you are using offers the weights in this format.