freeGPT answer not outputing to gradio

126 Views Asked by At

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()
0

There are 0 best solutions below