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

Using LM Studio and Pandas #362

Open
spederiva opened this issue Nov 20, 2024 · 0 comments
Open

Using LM Studio and Pandas #362

spederiva opened this issue Nov 20, 2024 · 0 comments

Comments

@spederiva
Copy link

When I run the following code against OpenAI, it returns the correct number of rows, but when I run it against LM Studio, it always return 5 rows

Any idea why?

Thanks

llm = ChatOpenAI(
    base_url="http://localhost:1234/v1",
    api_key="lm-studio",
    temperature=0.7,
    verbose=True
)

data = pd.read_csv(f"data.csv")

pandas_agent = create_pandas_dataframe_agent(
    llm=llm,
    df=data.sample(n=100),
    allow_dangerous_code = True, # read the warning above
    agent_type=AgentType.OPENAI_FUNCTIONS, 
    verbose=True, 
    include_df_in_prompt=True,
    agent_executor_kwargs={"handle_parsing_errors":True}
)

pandas_agent.invoke('1) how many rows are there?')
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

1 participant