Bhh / app.py
Docfile's picture
Update app.py
2923bfa
raw
history blame
671 Bytes
import gradio as gr
import g4f
def chatbot_interaction(input_text):
cc = "Act an personnage. Tu t'appelle Mariam et tu as été jouer par Youssouf. Répond à cette question : "
s = cc +" "+ input_text
response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', provider=g4f.Provider.DeepAi , messages=[
{"role": "user", "content": s }], stream=False)
print(response)
return response
iface = gr.Interface(
fn=chatbot_interaction,
inputs="text",
outputs="text",
layout="vertical",
title="Chatbot",
description="Interact with a chatbot based on GPT-3.5 Turbo."
)
iface.launch()