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

Unable to train using interface #1274

Closed
usmanbinimran-octopus opened this issue Jul 10, 2024 · 2 comments
Closed

Unable to train using interface #1274

usmanbinimran-octopus opened this issue Jul 10, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@usmanbinimran-octopus
Copy link

System Info

Windows 10
Python 3.9
PandasAi 2.2.5

🐛 Describe the bug

Hi PandasAI Team,

I am unable to see training QA or docs at: https://www.pandabi.ai/auth/sign-in
Did you guys removed it from front end?

Also unable to train using code!

Kr,
Usman Bin Imran

@dosubot dosubot bot added the bug Something isn't working label Jul 10, 2024
Copy link

dosubot bot commented Jul 10, 2024

To assist you with training using the PandasAI interface, please ensure you follow these steps:

  1. Set the PandasAI API Key:
    Make sure you have set your PandasAI API key as an environment variable. This is crucial for the training process.

    import os
    
    os.environ["PANDASAI_API_KEY"] = "YOUR_PANDASAI_API_KEY"
  2. Instructions Training:
    Use the train method on the Agent to provide specific instructions.

    from pandasai import Agent
    
    agent = Agent("examples/data/Loan payments data.csv")
    agent.train(docs="Only return loans information about the past 10 years")
    
    response = agent.chat("How many loans were paid off?")
    print(response)
  3. Q/A Training:
    Use the train method on the Agent to provide specific Q/A pairs.

    from pandasai import Agent
    
    agent = Agent("examples/data/Loan payments data.csv")
    
    # Train the model
    query = "How many loans were paid off?"
    code = """
    import pandas as pd
    
    df = dfs[0]
    df['loan_status'].value_counts()
    """
    agent.train(queries=[query], codes=[code])
    
    response = agent.chat(query)
    print(response)
  4. Troubleshooting:
    If you encounter the error No vector store provided. Please provide a vector store to train the agent, ensure that you have set the API key correctly. You can also instantiate the vector store directly with the API key.

    from pandasai import Agent
    from pandasai.vectorstores import BambooVectorStore
    
    # Instantiate the vector store with the API key
    vector_store = BambooVectorStore(api_key="YOUR_PANDASAI_API_KEY")
    
    # Instantiate the agent with the custom vector store
    agent = Agent("examples/data/Loan payments data.csv", vectorstore=vector_store)
  5. Clearing Previous Conversations:
    If you need to start a new training session, you can clear the previous conversation history.

    agent.start_new_conversation()
  6. Explanation of Code Execution:
    If you need to understand how the code reached a solution, you can use the explain method.

    explanation = agent.explain()
    print(explanation)

By following these steps, you should be able to train the PandasAI interface successfully [1][2][3].

To continue talking to Dosu, mention @dosu.

@usmanbinimran-octopus
Copy link
Author

Dear Team and @gventuri,

Hope this message finds you well. While testing the Agent class, it came to our notice that Agent unexpectedly stopped using trained data. I am attaching the screenshot of console:
Screenshot 2024-07-11 094314

We are also unable to train Agent using interactive screen provided by PandasAI at: https://www.pandabi.ai/admin/
Screenshot 2024-07-11 094746

We are looking forward to your prompt response, as this is critical for our proof of concept development.

Kind regards,
Usman Bin Imran
+92-310-480-160-1

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Oct 10, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant