hahrobot / app.py
uhygfd's picture
Upload 3 files
c3a80d7 verified
raw
history blame
864 Bytes
import requests
import gradio as gr
def generate(message):
url = "https://p-bot-h629.onrender.com/ask"
headers = {"Content-Type": "application/json"}
data = {"text": message}
response = requests.post(url, json=data, headers=headers)
return response.text
# Настройка интерфейса чат-бота
mychatbot = gr.Chatbot(avatar_images=["./user.png", "./bot.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True)
# Создание интерфейса для чат-бота
demo = gr.ChatInterface(fn=generate,
chatbot=mychatbot,
title="ХахБот",
retry_btn=None,
undo_btn=None
)
# Запуск демонстрации чат-бота
demo.queue().launch(share=True)