Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: type object 'LLMMetadata' has no attribute 'model_fields' #621

Open
shreesha345 opened this issue Oct 25, 2024 · 2 comments

Comments

@shreesha345
Copy link

shreesha345 commented Oct 25, 2024


Describe the bug

An AttributeError occurs when attempting to initialize a Groq model using the llama_index.llms.groq package. The error specifically states that the LLMMetadata object does not have the attribute model_fields. This happens during an attempt to access the context_window description in the OpenAILike class.

To Reproduce

Steps to reproduce the behavior:

  1. Import the necessary packages from llama_index.llms.groq.
  2. Initialize a Groq model using the following code:
    llm = Groq(model="llama-3.1-70b-versatile", api_key=os.getenv("GROQ_API_KEY"))
    mmll = Groq(model="llama3-groq-70b-8192-tool-use-preview",api_key=os.getenv("GROQ_API_KEY"))
  3. Run the script.
  4. Observe the following error:
    AttributeError: type object 'LLMMetadata' has no attribute 'model_fields'
    

Expected behavior

The Groq model should initialize correctly, and the script should run without encountering an attribute error when trying to access metadata like context_window.

Screenshots

Here’s the error traceback that occurs:
image


@Arulakash-J
Copy link

same error for me too. Did you find any solution

@shreesha345
Copy link
Author

No still finding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants