Download app.py from juancru68/chatbot: direct link, hf CLI and curl.
- Browser
- Download file 420 Bytes
-
https://huggingface.co/spaces/juancru68/chatbot/resolve/main/app.py
- Command line
-
hf download hf://spaces/juancru68/chatbot/app.py
-
curl -L -o app.py https://huggingface.co/spaces/juancru68/chatbot/resolve/main/app.py
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) |