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 Implement Guardrails AI on GPT4All #449

Closed
Abdullah7700 opened this issue Nov 22, 2023 · 1 comment
Closed

Unable to Implement Guardrails AI on GPT4All #449

Abdullah7700 opened this issue Nov 22, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Abdullah7700
Copy link

Abdullah7700 commented Nov 22, 2023

Describe the bug
I'm working on a small research project to effectively implement guardrails on open source LLMs such as GPT4All and other Nomic and Leuther models. While implementing Guardrails AI on GPT4All, I am having the following problem:

To Reproduce

Steps to reproduce the behavior:

  1. Image of Rail:

image

  1. Runtime arguments:

raw_llm_output, validated_output = guard(
model.generate,
prompt_params={"question": "Give me a brief history of the second world war?"},
temperature=0
)

Expected behavior
Having implemented Guardrails AI on ChatGPT by OpenAI, I want this code to work in a similar manner in that I get a validated output by the end which has been verified by the created Guardrails spec.

Error Message:
The callable fn passed to Guard(fn, ...) failed with the following error: GPT4All.generate() got an unexpected keyword argument 'temperature'. Make sure that fn can be called as a function that takes in a single prompt string and returns a string.

My Understanding of the Problem
From what I've been able to understand, GPT4All has the keyword 'temp' for temperature e.g.

model.generate(prompt='what is the capital of France?', temp=0)

On the other hand, Guardrails AI requires the keyword temperature parameter to be given. I think that is causing a clash.

If my assessment is incorrect, what is the problem and how to solve it? If I am right, how can this be resolved?

@Abdullah7700 Abdullah7700 added the bug Something isn't working label Nov 22, 2023
@irgolic
Copy link
Contributor

irgolic commented Dec 4, 2023

Hey, sorry for the late reply. See here for an example of how to use GPT4All with guardrails: https://github.com/guardrails-ai/guardrails/blob/gpt4all-example/docs/examples/gpt4all-guardrails.ipynb

@irgolic irgolic closed this as completed Dec 4, 2023
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

2 participants