Find answers from the community

Updated 6 months ago

@Logan M

@Logan M

Hi,
I am using PandasQueryEngine and it works well with Opensource LLMs in both Jupyter notebook and Python file.
However, I have a very weird issue;
When I install all the same libraries in a new PC, the code works in Jupyter notebook, however, does not work as Python file!!!
Here is the error when running it as Python file in a new PC:

df[df['Technique ID'] == 'T1087'] - response: df[df['Technique ID'] == 'T1087'] Traceback (most recent call last): File "./.venv/lib/python3.10/site-packages/llama_index/experimental/query_engine/pandas/output_parser.py", line 40, in default_output_processor tree = ast.parse(output) File "/usr/lib/python3.10/ast.py", line 50, in parse return compile(source, filename, mode, flags, File "<unknown>", line 2 - response: df[df['Technique ID'] == 'T1087'] ^^^^^^^^^^ SyntaxError: illegal target for annotation Pandas Output: There was an error running the output as Python code. Error message: illegal target for annotation (<unknown>, line 2)

It seems that it forgets to add parenthesis after df[]!

Can you please help me in this regard?
L
a
15 comments
LLMs are not entirely deterministic: theres not much to do here besides try/excepting it and trying again
It is not the error of LLM
I believe its a bug or sth wrong on my env
it only works in one of my envs in both jupyter and python,
However, in other machines, it only works in Jupyter!
Totally weird.
I have tires it with 3 different machines, only the first one works well
I'm pretty sure its an llm error
It wrote

- response: df[df['Technique ID'] == 'T1087']
which cannot be executed as python code
here is the asnwer in jupyter:

Pandas Instructions:
Plain Text
df[(df['Technique ID'] == 'T1087')]['Detection Method']
u see there's df[(df[ ......
however, in the previous error it is like: df[df[.....
there is a missed ''('' in the answer! also ''')''
idk, looking at the traceback, I really think the LLM just wrote something incorrectly lol

Try increasing the temperature of the LLM, run it a few times
Just to update you.
When I add Bitsandbytes kwargs, the model works, however, without it, does not work! At least for the machines that I have tried!
Add a reply
Sign up and join the conversation on Discord