PG_Henry / app.py
matiasbonfanti's picture
primera prueba
0ae232f
raw
history blame
577 Bytes
import gradio as gr
import openai
openai.api_key = "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"
def respuesta(review):
response = openai.Completion.create(
model="text-davinci-003",
prompt= f"Responder la siguiente reseña. nombre: Leon. {review}",
temperature=0.5,
max_tokens=300,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
return response.choices[0].text
def greet(name):
return "Hello " + name + "!!"
iface = gr.Interface(fn=respuesta, inputs="text", outputs="text")
iface.launch()