hahrobot / app.py
uhygfd's picture
Update app.py
f39609c verified
raw
history blame contribute delete
No virus
872 Bytes
import requests
import gradio as gr
def generate(message, _=None):
url = "https://p-bot-okfe.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)