-
Notifications
You must be signed in to change notification settings - Fork 400
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
Evaluate is not working #420
Comments
Thanks @jackchan0528. @trebedea should be able to help with this early next week. Let me know if this is urgent and I can try to help as well. |
Thanks for reporting this @jackchan0528 , evaluate was not working with chat LLMs from Langchain. The evaluation package was created before Langchain branched off the BaseChatModel as a different base class for chat models. This should solve your main problem. However, I was not able to replicate the second one with the unicode error.
I used the test set from Anthropic HH (test.jsonl.gz). I will close this, just reopen if the problems persist. |
Fix #420 - evaluate not working with chat models
Following the doc here: https://github.com/NVIDIA/NeMo-Guardrails/blob/develop/nemoguardrails/eval/data/moderation/README.md
I unzip the required text files under eval/data/moderation folder, and tried running the commands:
nemoguardrails evaluate moderation --config=config --dataset-path .\eval\data\moderation\anthropic_harmful.txt --split harmful
nemoguardrails evaluate moderation --config=config --dataset-path .\eval\data\moderation\anthropic_helpful.txt --split helpful
For the harmful one, I got this error:
and for the helpful one, the error is:
It seems that there are 2 main issues. One is that the "Y" could possibly be the answer from the rails (Yes). But it does not get recognized by any instance type defined under langchain_openai/chat_models/base.py _convert_message_to_dict(), quoting it below:
`def _convert_message_to_dict(message: BaseMessage) -> dict:
"""Convert a LangChain message to a dictionary.
and for the second issue, I believe you need to have the "encoding="utf8"" somewhere in the code.
@drazvan
The text was updated successfully, but these errors were encountered: