I have fine tuned a custom dataset using GPT3. I created a simple program to take user input (a question) and return the correct response. The program works, however it returns additional question and answers from the dataset I uploaded to the model.
I tried to reduce the max tokens cap and have set the temperature to 0, but I cannot seem to figure out how to stop the program from returning the additional questions and answers. Has anyone encountered this problem and if so how can I fix it?
Here is my code:
import openai
openai.api_key = "MY_API_KEY"
def respond(prompt):
completions = openai.Completion.create(
engine="MY_FINED_TUNED_MODEL",
prompt=prompt,
max_tokens=50,
n=1,
stop=None,
temperature=0,
)
message = completions.choices[0].text
return message
while True:
prompt = input("Enter your question: ")
if prompt.lower() == "end":
break
response = respond(prompt)
print(response)