Use a Python agent for CSV work on a local model

A commenter said LangChain’s create_python_agent handled CSV analysis acceptably when paired with nous-hermes-llama2 13B.

Done with Custom agent· Intermediate· Aug 2023

What they did
Someone asked how to use Llama 2 in LangChain to inspect a CSV on a local machine. They said LangChain’s pandas-focused agent had done fine with OpenAI models, but the same setup gave poor results when they tried a quantized 7B Llama. In response, they suggested using create_python_agent instead and said that setup was usable with nous-hermes-llama2 13B.
How it went
Their report was limited to a general comparison: the quantized 7B model underperformed, and the Hermes-based setup was satisfactory. The thread did not include a concrete analysis run, measurements, or a detailed breakdown of the failure.
Tips
If a built-in data agent is not giving good answers, test a broader Python agent next. Treat results from a local model as provisional and review the code and outputs before relying on them.

Try it yourself with Hermes Agent

I have data in [file path] and need to answer [analysis question]. Use a Python agent to load the data, inspect it for missing or odd values, and explore the question step by step by writing and running code. Show me each code block and its output, then end with a brief plain-language summary. Do not change the original file. If you need to save a file, submit anything, delete anything, or make any other irreversible change, stop first and ask for my approval.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.