Hello community members.
I am looking to create a chatbot that will read my information into GPT-3 and output my personal information.
I want to give that QR code to every businessman I meet!
Because it’s so current and cool!!!
So I want to run the following program in GOOGLE COLAB, but although it reads the data, it only outputs what GPT-3 has learned from the beginning.
What do you think the problem is?
I’d love to borrow some of your genius brains!
!pip install openai
import openai
import csv
API
openai.api_key = “xxxxx”
input CSV
questions =
answers =
with open(“xxx.csv”, “r”) as f:
reader = csv.reader(f)
for row in reader:
questions.append(row[0])
answers.append(row[1])
def generate_answer(prompt):
completions = openai.Completion.create(
engine=“text-davinci-002”,
prompt=prompt,
max_tokens=1000,
n=1,
stop=None,
temperature=0.5,
)
message = completions.choices[0].text
return message.strip()
input
for i in range(len(questions)):
prompt = questions[i]
answer = generate_answer(prompt)
print(f"question: {prompt}")
print(f"answer: {answer}")
print()