I was trying to make basic gpt chat using free gpt and gradio but this code is doesnt output anything. I tried hosting on spaces but it stil won't output anything.
Code:
import freeGPT
import asyncio
import gradio as gr
async def chat(prompt):
resp = await getattr(freeGPT, "gpt3").Completion.create(prompt)
return resp['choices'][0]['text'] # Extract the text content from the GPT response
def complete(prompt):
return asyncio.run(chat(prompt))
demo = gr.Interface(complete, ["text"], ["text"])
demo.launch()