chatbot / app.py
juancru68's picture
Upload folder using huggingface_hub
9718baa verified
Raw History Blame Contribute Delete
420 Bytes
import gradio as gr
from src.rag import chat
def response(message, history):
history = history or []
response_text = chat(message)
history.append({"role": "user", "content": message})
history.append({"role": "assistant", "content": response_text})
return history
demo = gr.ChatInterface(fn=response, type="messages", examples=["hello", "hola", "merhaba"], title="Echo Bot")
demo.launch(share=True)