I have been working with the openai with python3 and i getting the error:
model = openai.Model.load(“text-davinci-002”)
AttributeError: type object ‘Model’ has no attribute ‘load’
please how do you resolve this.
thank you
I have been working with the openai with python3 and i getting the error:
model = openai.Model.load(“text-davinci-002”)
AttributeError: type object ‘Model’ has no attribute ‘load’
please how do you resolve this.
thank you
I don’t believe that function exists. Is there documentation somewhere that suggests that that should work? Can you tell me a bit more about what you’re trying to do?
this is the code i am running:
import os
import openai
import sys
openai.api_key = os.getenv(“OPENAI_API_KEY”)
model = openai.Model.load(“text-davinci-002”)
prompt = " ".join(sys.argv[1:])
completions = model.complete(prompt, max_tokens=1024, temperature=0.7)
message = completions.text.strip()
print(message)
Try this: (or something very close to this - not tested)
import os
import openai
import sys
openai.api_key = os.getenv(“OPENAI_API_KEY”)
strprompt = " ".join(sys.argv[1:])
completions = openai.Completion.create(prompt=strprompt, max_tokens=1024, temperature=0.7, engine=“text-davinci-002”)
message = completions[“choices”][0][“text”].strip()
print(message)
with very minor tweeks, worked like a charm.
thanks