Spaces:
Sleeping
Sleeping
| # Week - 3 Assignment - Integrate Traditional Chatbot with AI Service Project (Transformers) Praveen Kumar Parimi | |
| #importing the required libraries including transformers | |
| import gradio as gr | |
| from transformers import pipeline | |
| def chat_response(prompt): | |
| model_name = "bmas10/ForJerry" | |
| pipe = pipeline("text-generation", model=model_name) | |
| messages = [{"role": "user", "content": prompt}] | |
| return pipe(messages) | |
| iface = gr.Interface( | |
| fn=chat_response, | |
| inputs=gr.Textbox(placeholder="Type your message here..."), | |
| outputs=gr.Textbox() | |
| ) | |
| iface.launch() | |