Spaces:
Sleeping
Sleeping
Create app.py
Browse files123456789101112131415161718192021222324import gradio as grimport openaiimport os
openai.api_key = os.environ["OPENAI_KEY"]
def answer_question(question): response = openai.Completion.create( engine="text-davinci-002", prompt="Make a step by step how to based on the prompt: " + question, max_tokens=1024, n=1, stop=None, temperature=0.5, ).get("choices")[0].text return response
iface = gr.Interface(answer_question, gr.inputs.Textbox(lines=5, default="How do i use GPT3?"), gr.outputs.Textbox(), title="How to generator", description="Make how tos from any prompt.")
iface.launch()app.pyAdded+24