Spaces:
Sleeping
Sleeping
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() |