Spaces:
Runtime error
Runtime error
Download app.py from HugManish22/AI_CHATBOT: direct link, hf CLI and curl.
- Browser
- Download file 663 Bytes
-
https://huggingface.co/spaces/HugManish22/AI_CHATBOT/resolve/main/app.py
- Command line
-
hf download hf://spaces/HugManish22/AI_CHATBOT/app.py
-
curl -L -o app.py https://huggingface.co/spaces/HugManish22/AI_CHATBOT/resolve/main/app.py
663 Bytes
| from transformers import pipeline, Conversation | |
| import gradio as gr | |
| Chatbot = pipeline(task = "conversational", model ="facebook/blenderbot-400M-distill") | |
| #text, get it from user from gradio | |
| message_list = [] | |
| response_list = [] | |
| def mini_chatbot(message, history): | |
| conversation = Conversation(text = message, | |
| past_user_inputs = message_list, | |
| generated_responses = response_list) | |
| response = Chatbot(conversation) | |
| return response.generated_responses[-1] | |
| demo_chatbot = gr.ChatInterface(mini_chatbot, title="AI Chatbot" , description="Enter text to CHAT with AI") | |
| demo_chatbot.launch() |