Spaces:
Sleeping
Sleeping
File size: 323 Bytes
a64d886 363a1de a64d886 e45ad39 a64d886 e45ad39 a64d886 06f4c1d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import os
import openai
def gpt(api_key):
completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "Generate a fake news story"}]
)
return completion.choices[0].message.content
demo = gr.Interface(fn=gpt, inputs="text", outputs="text")
demo.launch() |