Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from transformers import pipeline | |
| # موديل دردشة خفيف مناسب CPU | |
| chatbot = pipeline("text-generation", model="/blenderbot-400M-distill") | |
| def chat_with_ai(message, history): | |
| response = chatbot(message, max_length=200, do_sample=True) | |
| reply = response[0]['generated_text'] | |
| return reply | |
| demo = gr.ChatInterface( | |
| fn=chat_with_ai, | |
| title="Adhem AI Chatbot 🤖", | |
| description="بوت دردشة تجريبي بالذكاء الاصطناعي", | |
| type="messages" | |
| ) | |
| demo.launch() |